liveBook · Manning

TensorFlow.js

As explained in Deep Learning with Python, Third Edition

A JavaScript TensorFlow ecosystem library for running models in browsers or other JavaScript environments.

TensorFlow.js brings trained machine-learning models into browser-based JavaScript applications and desktop Electron apps. It can import a saved Keras model and query it locally, allowing an application to continue working after the model is downloaded and cached. section 6.3.2

Use TensorFlow.js with practical deployment constraints in mind:

  • Choose local inference when avoiding network round trips or preserving offline behavior matters. section 6.3.2
  • Check model size and resource use before targeting a smartphone or laptop; CPU, GPU, and RAM remain user-device constraints. section 6.3.2
  • Treat a client-delivered model as nonconfidential, especially when training data is sensitive. section 6.3.2
  • Optimize before importing into TensorFlow.js when memory, power, or latency is restricted; pruning and quantization provide size–accuracy tradeoffs. section 6.3.2

How Deep Learning with Python, Third Edition covers it

How deep it goes
Explains model import, device constraints, privacy, and optimization choices without detailing TensorFlow.js implementation internals.
Examples
Uses browser applications, Electron applications, cached offline models, and resource-constrained smartphones as deployment examples.
What you can do after
Apply it via TensorFlow.js to query an imported Keras model locally in a JavaScript application.
How it connects
Connects Keras API, TensorFlow APIs, ONNX, TensorFlow Lite, weight pruning, and weight 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 Python, Third Edition. The section links point to the parts of the book it draws on.