Each example directory is standalone so the directory can be copied
to another project.
| Example name |
Demo link |
Input data type |
Task type |
Model type |
Training |
Inference |
API type |
Save-load operations |
| abalone-node |
|
Numeric |
Loading data from local file and training in Node.js |
Multilayer perceptron |
Node.js |
Node.js |
Layers |
Saving to filesystem and loading in Node.js |
| addition-rnn |
๐ |
Text |
Sequence-to-sequence |
RNN: SimpleRNN, GRU and LSTM |
Browser |
Browser |
Layers |
|
| addition-rnn-webworker |
|
Text |
Sequence-to-sequence |
RNN: SimpleRNN, GRU and LSTM |
Browser: Web Worker |
Browser: Web Worker |
Layers |
|
| angular-predictive-prefetching |
|
Numeric |
Multiclass predictor |
DNN |
|
Browser: Service Worker |
Layers |
|
| baseball-node |
|
Numeric |
Multiclass classification |
Multilayer perceptron |
Node.js |
Node.js |
Layers |
|
| boston-housing |
๐ |
Numeric |
Regression |
Multilayer perceptron |
Browser |
Browser |
Layers |
|
| cart-pole |
๐ |
|
Reinforcement learning |
Policy gradient |
Browser |
Browser |
Layers |
IndexedDB |
| chrome-extension |
|
Image |
(Deploying TF.js in Chrome extension) |
Convnet |
|
Browser |
|
|
| custom-layer |
๐ |
|
(Defining a custom Layer subtype) |
|
|
Browser |
Layers |
|
| data-csv |
๐ |
|
Building a tf.data.Dataset from a remote CSV |
|
|
|
|
|
| data-generator |
๐ |
|
Building a tf.data.Dataset using a generator |
Regression |
Browser |
Browser |
Layers |
|
| date-conversion-attention |
๐ |
Text |
Text-to-text conversion |
Attention mechanism, RNN |
Node.js |
Browser and Node.js |
Layers |
Saving to filesystem and loading in browser |
| electron |
|
Image |
(Deploying TF.js in Electron-based desktop apps) |
Convnet |
|
Node.js |
|
|
| fashion-mnist-vae |
|
Image |
Generative |
Variational autoencoder (VAE) |
Node.js |
Browser |
Layers |
Export trained model from tfjs-node and load it in browser |
| interactive-visualizers |
|
Image |
Multiclass classification, object detection, segmentation |
|
|
Browser |
|
|
| iris |
๐ |
Numeric |
Multiclass classification |
Multilayer perceptron |
Browser |
Browser |
Layers |
|
| iris-fitDataset |
๐ |
Numeric |
Multiclass classification |
Multilayer perceptron |
Browser |
Browser |
Layers |
|
| jena-weather |
๐ |
Sequence |
Sequence-to-prediction |
MLP and RNNs |
Browser and Node |
Browser |
Layers |
|
| lstm-text-generation |
๐ |
Text |
Sequence prediction |
RNN: LSTM |
Browser |
Browser |
Layers |
IndexedDB |
| mnist |
๐ |
Image |
Multiclass classification |
Convolutional neural network |
Browser |
Browser |
Layers |
|
| mnist-acgan |
๐ |
Image |
Generative Adversarial Network (GAN) |
Convolutional neural network; GAN |
Node.js |
Browser |
Layers |
Saving to filesystem from Node.js and loading it in the browser |
| mnist-core |
๐ |
Image |
Multiclass classification |
Convolutional neural network |
Browser |
Browser |
Core (Ops) |
|
| mnist-node |
|
Image |
Multiclass classification |
Convolutional neural network |
Node.js |
Node.js |
Layers |
Saving to filesystem |
| mnist-transfer-cnn |
๐ |
Image |
Multiclass classification (transfer learning) |
Convolutional neural network |
Browser |
Browser |
Layers |
Loading pretrained model |
| mobilenet |
๐ |
Image |
Multiclass classification |
Convolutional neural network |
|
Browser |
Layers |
Loading pretrained model |
| polynomial-regression |
๐ |
Numeric |
Regression |
Shallow neural network |
Browser |
Browser |
Layers |
|
| polynomial-regression-core |
๐ |
Numeric |
Regression |
Shallow neural network |
Browser |
Browser |
Core (Ops) |
|
| quantization |
|
Various |
Demonstrates the effect of post-training weight quantization |
Various |
Node.js |
Node.js |
Layers |
|
| sentiment |
๐ |
Text |
Sequence-to-binary-prediction |
LSTM, 1D convnet |
Node.js or Python |
Browser |
Layers |
Load model from Keras and tfjs-node |
| simple-object-detection |
๐ |
Image |
Object detection |
Convolutional neural network (transfer learning) |
Node.js |
Browser |
Layers |
Export trained model from tfjs-node and load it in browser |
| snake-dqn |
๐ |
|
Reinforcement learning |
Deep Q-Network (DQN) |
Node.js |
Browser |
Layers |
Export trained model from tfjs-node and load it in browser |
| translation |
๐ |
Text |
Sequence-to-sequence |
LSTM encoder and decoder |
Node.js or Python |
Browser |
Layers |
Load model converted from Keras |
| tsne-mnist-canvas |
|
|
Dimension reduction and data visualization |
tSNE |
Browser |
Browser |
Core (Ops) |
|
| webcam-transfer-learning |
๐ |
Image |
Multiclass classification (transfer learning) |
Convolutional neural network |
Browser |
Browser |
Layers |
Loading pretrained model |
| website-phishing |
๐ |
Numeric |
Binary classification |
Multilayer perceptron |
Browser |
Browser |
Layers |
|
Before you send a pull request, it is a good idea to run the presubmit tests
and make sure they all pass. To do that, execute the following commands in the
root directory of tfjs-examples: