TensorFlow.js puts machine learning in the browser

(Image: TensorFlow)

12 September 2018

Google’s TensorFlow open source machine learning library has been extended to JavaScript with Tensorflow.js, a JavaScript library for deploying machine learning models in the browser.

A WebGL-accelerated library, Tensorflow.js also works with the Node.js server-side JavaScript runtime and is part of the TensorFlow ecosystem. With machine learning directly in the browser, there is no need for drivers; developers can just run code.

The project, which features an ecosystem of JavaScript tools, evolved from the Deeplearn.js library for browser-based machine learning; Deeplearn.js is now known as Tensorflow.js Core.

TensorFlow.js APIs can be used to build models using the low-level JavaScript linear algebra library or the higher-level layers API. TensorFlow.js model converters can run existing models in the browser or under Node.js. Existing models can be retrained using sensor data connected to the browser.

A tensor serves as the central unit of data. Also, a high-level, Keras-inspired API is included for building neural networks. But TensorFlow.js is not the only JavaScript library built for neural networking; TensorFire, built by MIT students, executes neural networks in a webpage.

Tensorflow.js has an API similar to TensorFlow’s Python API. But the JavaScript API does yet not support all the functionality of the Python API. Builders of Tensorflow.js pledge to achieve parity where it makes sense but want to provide an idiomatic JavaScript API. TensorFlow with WebGL also runs at 50 to 60% the speed of the TensorFlow Python API used with the AVX library.

Planned enhancements for Tensorflow.js include:

  • A visualisation library to perform quick visualisations of the model and data.
  • Performance improvements in the browser.
  • WebGL optimisation.
  • A browser- and Node-specific data API.
  • Cloud integration on the Node.js side, including serverless-type integration points.
  • Better async support with the libuv asynchronous I/O library.

TensorFlow.js can be downloaded from GitHub.



IDG News Service

Read More:

Back to Top ↑