Tutorials & Guides


Getting Started

Core Concepts in TensorFlow.js

Learn about core concepts in TensorFlow.js such as tensors, operations, models, layers and training. Also learn a few useful tips about memory management and writing "tidy" code.

TensorFlow.js Layers API for Keras Users

This guide explains the similarities and differences between the Layers API of TensorFlow.js and Keras.

How to get started with X: a guide for TensorFlow.js Users

This guide provides a number of resources for getting started with the different domains involved in programming with TensorFlow.js.

Training Models

Training First Steps: Fitting a Curve to Synthetic Data

This tutorial demonstrates building a small toy model completely from scratch using TensorFlow.js operations. We will fit a curve to some synthetic data that we generate using a polynomial function.

Training on images — Recognizing Handwritten Digits with a Convolutional Neural Network

This tutorial shows how to build a convolutional neural network to recognize handwritten digits in images (MNIST). We will use the TensorFlow.js layers API to construct, train, and evaluate the model.

Transfer learning - Train a neural network to predict from webcam data

This tutorial explains how to train a neural network to make predictions from webcam data. We'll use those predictions to play Pac-Man!

Transfer learning - Build an Audio Recognition Model

In this tutorial you will build an audio recognition network and use it to control a slider in the browser by making sounds.

Saving and Loading tf.Model

This tutorial explains how to save tf.Models to various destinations such as the web browser's Local Storage and load them back.

Working with Pre-trained Models

How to import a Keras Model into TensorFlow.js

This tutorial explains how to convert and serve an existing Keras model to run in the browser.

How to import a TensorFlow SavedModel into TensorFlow.js

This tutorial explains how to convert and serve an existing TensorFlow SavedModel to run in the browser.

Advanced Topics

How to define a custom WebGL operation

This tutorial explains how to create a custom WebGL operation that can be used alongside other Tensorflow.js operations.