TensorFlow’s project for machine learning in the browser celebrates first major release

TensorFlow’s project for machine learning in the browser celebrates first major release

TensorFlow.js, a library for training and deploying JavaScript machine learning (ML) models in the browser, has reached its first major milestone and is now available in v1.0.

The team behind the project mainly focused on stabilising the API and improving the performance of the system for its first major release, announced at the TensorFlow Dev Summit 2019. Fitting, if you remember that the library was announced at that exact event only last year.

Since then, performance improvements across platforms have lain heavily on the minds of the team, especially when it comes to mobile devices. Frontend software engineer Yannick Assogba used the stage to present some examples of the progress made in the last months, mentioning speed-ups in interference time for a mobile-friendly image classification model by a factor 1.4 on Google’s Pixel 2 up to 9.4 on the iPhone X.

There aren’t many new features in the current release, but developers can now utilise Tensor.array() and Tensor.arraySync(), which return deeply nested arrays in the same logical shape as tf.Tensor. A quick glance at the release notes is deeply recommended, since v1.0 comes with a number of breaking changes – mainly in the form of deprecations and deletions in favour of renamed or improved functions.

Examples that don’t match that pattern include the fact that graphs converted from TensorFlow now generate JSON graphs and that the [xs, ys] tuple format has been removed for LayersModel.fitDataset. The latter now only accepts {xs, ys} as a dictionary mapping.

In the coming months the TensorFlow.js team will, according to Assogba, work on letting users run SavedModels in Node.js without having to convert the models first, and expand their platform support to things like the Raspberry Pi. Other than that the number of pre-trained models should increase to provide users with a greater variety of options to conquer machine learning problems without the need for in-depth ML knowledge.

Browsers play an integral role in the success of the project, which is why the team will also continue to have an eye on acceleration proposals and track the APIs coming from it to make the most of all the available ways to speed TensorFlow.js operations up.