Getting Started with TensorFlow.js
Machine Learning in the Browser
Several trends in our industry are colliding and creating new opportunities while complicating our technology choices. The Web continues to be the major platform for deploying modern applications in lightweight, zero-installation and cross-platform environments. Machine Learning is emerging as a way of managing the explosion of data that we no longer have the capacity to approach with conventional strategies. Hardware is increasingly crucial to making these machine learning systems possible. Layered architectures that embrace mobile, edge and cloud computing complicate where data and code land.
This gives us the capacity to move machine learning inference to the edge where many people have powerful GPU capabilities, do not need to push potentially sensitive data to a third party service, and decisions can be localized without the need for the latency of invoking backend services. Beyond these new capabilities, Tensorflow.js represents some very deep thinking about these trends and how to deal with them.
We will cover using pre-trained models that can be fetched remotely as well as the ability to train them directly in the browser. There will be several fun and exciting demonstrations and examples to run and work through.
What you'll learn-and how you can apply it
By the end of this live, hands-on, online course, you’ll understand:
- What TensorFlow.js is
- How TensorFlow.js is added to your web application
- How TensorFlow.js can be used to add machine learning capabilities to your web application
- How TensorFlow.js takes advantage of Graphical Processing Units (GPUs) directly and indirectly
And you’ll be able to:
- Feed machine learning algorithms with data available to the browser
- Reuse code in the front and backend
This training course is for you because...
- You have problems that do not fit solely into conventional backend ML environments
- You want to gain reuse in ML code across both front and backend environments
- General awareness of machine learning workflows and processes.
- There is no special setup, but it will require a modern browser that supports WebGL.
- We will not assume much background in machine learning, but time spent going through existing machine learning courses, such as Getting started with machine learning, will be well spent.
- Deep Learning in the Browser (book)
About your instructor
Brian Sletten is a liberal arts-educated software engineer with a focus on forward-leaning technologies. His experience has spanned many industries including retail, banking, online games, defense, finance, hospitality and health care. He has a B.S. in Computer Science from the College of William and Mary and lives in Auburn, CA. He focuses on web architecture, resource-oriented computing, social networking, the Semantic Web, data science, 3D graphics, visualization, scalable systems, security consulting and other technologies of the late 20th and early 21st Centuries.
The timeframes are only estimates and may vary according to how the class is progressing
Introduction: Machine Learning Overview (10 minutes)
- Presentation: Introduction
- Q&A: We will make sure everyone is comfortable with the high level ideas of machine learning.
Iris Dataset (10 minutes)
- Presentation: This is the “Hello, World!” of machine learning datasets. We will have a quick introduction to its structure so participants are comfortable with the first few exercises.
Iris: Loading Pre-Existing Models (30 minutes)
- Exercise: We will ask the participants to load a pre-existing version of a model trained on the Iris dataset so that it can be used to classify samples locally.
- Break: 5 min
Iris: Training in the Browser (35 minutes)
- Exercise: We will ask the participants to train a version of the model locally using some default parameters and assess how well it did.
- Exercise: We will ask the participants to change some of the parameters before retraining the model locally and see how the prediction quality changes.
Linear Regression (30 minutes)
- Exercise: We will ask the participants to train a model on some linear data and make predictions with what is generated.
- Break: 5 min
Working with Keras Models (45 minutes)
- Exercise: We will ask the participants to load a pre-trained Keras model into the Tensorflow.js library and use it locally.
- Exercise: We will ask the participants to use the Tensorflow.js Layers API to create Keras-like models locally.
- Break: 5 min
Working with TensorFlow Models (45 minutes)
- Exercise: We will ask the participants to load and use a pre-trained example model from the Tensorflow.js models repo.
- Exercise: We will ask the participants to load a pre-trained Tensorflow SavedModel and use it to make predictions locally.
- Exercise: We will ask the participants to load a pre-trained Tensorflow Hub model and use it to make predictions locally.
- Q&A: 5 min
- Break: 5 min
WebRTC + Tensorflow.js (35 minutes)
- Exercise: We will ask the participants to use a pre-trained model to interact with their webcams using WebRTC.