liveBook · Manning

TensorFlow.js

As explained in Deep Learning with R, Third Edition

TensorFlow.js is a JavaScript library for running and developing machine-learning models in browsers and JavaScript environments.

TensorFlow.js is a JavaScript library for running and developing machine-learning models in browsers and other JavaScript environments. It supports browser applications and desktop Electron apps, including offline inference after a model is downloaded and cached. section 6.3.2

TensorFlow.js supports practical deployment choices:

  • Import a saved Keras model and query it from a browser-based JavaScript application or Electron desktop application. section 6.3.2
  • Use the Keras API and many lower-level TensorFlow APIs through the JavaScript ecosystem. section 6.3.2
  • Optimize models before deployment when device memory, power, or latency is constrained; pruning trades model size against accuracy. section 6.3.2

Offline browser inference

A browser application can download and cache a saved Keras model, then use TensorFlow.js to make predictions without another network round trip. This approach suits models small enough for the user's CPU, GPU, and RAM, and requires accepting that the downloaded model is not confidential. section 6.3.2

How Deep Learning with R, Third Edition covers it

How deep it goes
Explains API compatibility and model import, but stops short of implementation code or detailed runtime internals.
Examples
Uses browser applications, Electron applications, cached models, and resource-constrained devices as deployment examples.
What it assumes
Assumes a trained saved model and requires choosing a deployment size that fits the target device's resources.
What you can do after
Apply it via TensorFlow.js to load a saved Keras model and query predictions from JavaScript.
How it connects
Connects JavaScript inference with Keras, TensorFlow, ONNX, TensorFlow Lite, pruning, and quantization.

Also explained in

Compare how 3 books explain TensorFlow.js →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.