Counting 3,742 Big Data & Machine Learning Frameworks, Toolsets, and Examples...
Suggestion? Feedback? Tweet @stkim1

Author
Last Commit
Apr. 21, 2019
Created
Mar. 5, 2018

TensorFlow.js Examples

This repository contains a set of examples implemented in TensorFlow.js.

Each example directory is standalone so the directory can be copied to another project.

Overview of Examples

Example name Demo link Input data type Task type Model type Training Inference API type Save-load operations
addition-rnn ๐Ÿ”— Text Sequence-to-sequence RNN: SimpleRNN, GRU and LSTM Browser Browser 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
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 Multilayer perceptron 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
fashion-mnist-vae Image Generative Variational autoencoder (VAE) Node.js Browser Layers Export trained model from tfjs-node and load it in 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)
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
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

Dependencies

Except for getting_started, all the examples require the following dependencies to be installed.

How to build an example

cd into the directory

If you are using yarn:

cd mnist-core
yarn
yarn watch

If you are using npm:

cd mnist-core
npm install
npm run watch

Details

The convention is that each example contains two scripts:

  • yarn watch or npm run watch: starts a local development HTTP server which watches the filesystem for changes so you can edit the code (JS or HTML) and see changes when you refresh the page immediately.

  • yarn build or npm run build: generates a dist/ folder which contains the build artifacts and can be used for deployment.

Contributing

If you want to contribute an example, please reach out to us on Github issues before sending us a pull request as we are trying to keep this set of examples small and highly curated.