Tensorflowjs: A Webgl Accelerated, Browser-Based Javascript Library For Training And Deploying ML Models

March 31, 2018, 4:03 p.m. By: Kirti Bakshi


The TensorFlow Dev Summit as we know is a full day flagship event of TensorFlow, that comprises of conversations, demos, and highly technical talks with the team and community of TensorFlow. The event that from around the world had its aim at bringing together a diverse mix of machine learning users came to a start on the 30th of March this year.

Today Tensorflow announced New blog, JS support(TensorFlow.js), new crash course, and youtube channel are some highlights.

What is TensorFlow.js:

Tensorflow.js is an open-source library that, making the use of Javascript and a high-level layers API can be used to define, train, as well as run machine learning models entirely in the browser. If you come out to be a Javascript developer who is new to ML, TensorFlow.js is a great way to get started.

On the other hand, if you’re an ML developer who is new to Javascript, go on reading in order to learn more about new opportunities for in-browser ML:

What All Can One Do With Tensorflow.Js?

If one is developing with TensorFlow.js, here are three workflows that can be considered:

1. Ability to import an existing, pre-trained model for inference:

If the user has an existing TensorFlow or Keras model that has been previously trained offline, it can be converted into TensorFlow.js format, and then be loaded into the browser for inference.

2. Ability to re-train an imported model:

The user can also, making the use of a small amount of data collected in the browser using a technique called Image Retraining can make the use of transfer learning in order to augment an existing model that has previously been trained offline.

Thus, This is one way that helps train an accurate model quickly, using only a small amount of data.

3. One can now Author models directly in the browser:

The user can also make the use of TensorFlow.js using Javascript and a high-level layers API to define, train, as well as run models entirely in the browser. If one is already familiar with Keras, the high-level layers API should feel familiar as well.

Adding on, TensorFlow.js also includes a low-level API that was previously deeplearn.js and a support for Eager execution. A lot more about these can be learned by watching the talk at the TensorFlow Developer Summit.

In addition, it’s also ready to run with GPU acceleration as well. TensorFlow.js supports WebGL automatically, and therefore behind the scenes will accelerate your code when a GPU is available. Users even from a mobile device may also open your webpage, in which case your model can take advantage of sensor data. Finally, summing up, all data stays on the client, that makes TensorFlow.js useful not only for low-latency inference but for privacy-preserving applications as well.

An Overview Of Tensorflow.Js Api's:

TensorFlow.js, the open-source library is powered by WebGL and for defining models provides a high-level layer API, and for linear algebra and automatic differentiation a low-level API. TensorFlow.js supports the importing of TensorFlow Saved Models and Keras models.


Now, Finally How Does Tensorflow.Js Relate To Deeplearn.Js?

TensorFlow.js, an ecosystem of JavaScript tools for machine learning, is the successor to deeplearn.js which is now known as TensorFlow.js Core. TensorFlow.js also has an inclusion of a Layers API, which is a higher level library for building machine learning models that use Core, as well as tools for automatically porting TensorFlow Saved Models and Keras hdf5 models.

Where Can The Users Reach Out To Learn More?

In order to learn more about TensorFlow.js, one can visit link given below, go through the tutorials, and try the examples as well. Further, one can also watch the talk from the 2018 TensorFlow Developer Summit.

Since we now know a bit, we’re excited to see what you all create with TensorFlow.js!

For More Information: GitHub