ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more

TensorFlow for JavaScript development

Before starting on the learning materials below, you should:

  1. Be comfortable with browser programming using HTML, CSS, & JavaScript

  2. Be familiar with using the command line to run Node.js scripts

This curriculum is for people who want to:

  1. Build ML models in JavaScript

  2. Run existing models anywhere Javascript can run

  3. Deploy ML models to web browsers

TensorFlow.js lets you develop or execute ML models in JavaScript, and use ML directly in the browser client side, server side via Node.js, mobile native via React Native, desktop native via Electron, and even on IoT devices via Node.js on Raspberry Pi. To learn more about TensorFlow.js, and what can be done with it, check out this talk at Google I/O.

Step 1: Get introduced to machine learning in the browser

To get a quick introduction on basics for ML in JavaScript, watch the videos below that take you from first principles, to using existing pre-made models, and even building your own neural network for classification. You can also try the Make a smart webcam in JavaScript Codelab for an interactive walkthrough of these concepts.

Superpowers for next gen web apps: Machine Learning

This high level intro to machine learning in JavaScript is for web developers looking to take their first steps with TensorFlow.js.

Getting started with TensorFlow.js by TensorFlow

3 部構成のシリーズでは、TensorFlow.js を使った機械学習モデルのトレーニングと実行について解説し、JavaScript を使用してブラウザ上で直接実行する機械学習モデルを作成する方法も紹介します。

Make a smart webcam in JavaScript with a pre-trained model

Learn how to load and use one of the TensorFlow.js pre-trained models (COCO-SSD) and use it to recognize common objects it's been trained on.

ステップ 2: ディープ ラーニングに関する理解をさらに深化させる

To get a deeper understanding of how neural networks work, and a broader understanding of how to apply them to different problems, we have two books available.

Learning TensorFlow.js is a great place to start if you are new to Tensors and Machine Learning generally but have a good understanding of JavaScript. This book takes you all the way from the basics such as understanding how to manipulate data into Tensors, to quickly progressing to real world applications. After reading, you will understand how to load existing models, pass data to them, and interpret data that comes out.

Deep Learning with JavaScript is also a great place to start. It is accompanied by a large number of examples from GitHub so you can practice working with machine learning in JavaScript.

This book will demonstrate how to use a wide variety of neural network architectures, such as Convolutional Neural Networks, Recurrent Neural Networks, and advanced training paradigms such as reinforcement learning. It also provides clear explanations of what is actually happening with the neural network in the training process.

Learning TensorFlow.js
by Gant Laborde

A hands-on end-to-end approach to TensorFlow.js fundamentals for a broad technical audience. Once you finish this book, you'll know how to build and deploy production-ready deep learning systems with TensorFlow.js.

Deep Learning with JavaScript
by Shanqing Cai, Stanley Bileschi, Eric D. Nielsen with Francois Chollet

TensorFlow ライブラリの主要な作者によって執筆されたこの書籍では、ブラウザまたはノード上の JavaScript ディープ ラーニング アプリの興味深いユースケースと詳細な手順を解説しています。

ステップ 3 : TensorFlow.js とサンプルで練習を積む

Practice makes perfect, and getting hands on experience is the best way to lock in the concepts. Check out the TensorFlow.js codelabs to further your knowledge with these step by step guides for common use cases:

  1. Make your very own “Teachable Machine” from a blank canvas

  2. Handwritten digit recognition with Convolutional Neural Networks

  3. Make predictions from 2D data

  4. Convert a Python SavedModel to TensorFlow.js format

  5. Use Firebase to deploy and host a TensorFlow.js model

  6. Build a comment spam detection system

  7. Retrain a comment spam detection model to handle custom edge cases

  8. Audio recognition using transfer learning

With your knowledge of neural networks, you can more easily explore the open sourced examples created by the TensorFlow team. They are all available on GitHub, so you can delve into the code and see how they work.

TensorFlow.js を使用したサンプル

TensorFlow.js に実装された一連のサンプルを含む GitHub のリポジトリ。各サンプル ディレクトリはスタンドアロンであるため、ディレクトリを別のプロジェクトにコピーできます。

チュートリアルで、TensorFlow.js を使い始める方法をご覧ください。

TensorFlow のチュートリアルは、Jupyter ノートブックとして作成され、セットアップ不要のホスト型ノートブック環境である Google の Colab で直接実行されます。[Google Colab で実行] ボタンをクリックします。


ステップ 4: 独自の開発を始める

Once you've tested your knowledge, and practiced with some of the TensorFlow.js examples, you should be ready to start developing your own projects. Take a look at our pretrained models, and start building an app in minutes. Or you can train your own model using data you've collected, or by using public datasets. Kaggle and Google Dataset Search are great places to find open datasets for training your model.

If you are looking for inspiration, check out our Made With TensorFlow.js show and tell episodes from people all around the world who have used TensorFlow.js in their applications.

You can also see the latest contributions from the community by searching for the #MadeWithTFJS hashtag on social media.