Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Shanqing Cai, Stan Bileschi, Eric Nielsen

Rating No ratings yet

Deep learning has transformed the fields of computer vision, image processing, and natural language applications. Thanks to TensorFlow.js, now JavaScript developers can build deep learning apps without relying on Python or R. Deep Learning with JavaScript shows developers how they can bring DL technology to the web. Written by the main authors of the TensorFlow library, this new book provides fascinating use cases and in-depth instruction for deep learning apps in JavaScript in your browser or on Node. about the technology Running deep learning applications in the browser or on Node-based backends opens up exciting possibilities for smart web applications. With the TensorFlow.js library, you build and train deep learning models with JavaScript. Offering uncompromising production-quality scalability, modularity, and responsiveness, TensorFlow.js really shines for its portability. Its models run anywhere JavaScript runs, pushing ML farther up the application stack. About the Book In Deep Learning with JavaScript, you’ll learn to use TensorFlow.js to build deep learning models that run directly in the browser. This fast-paced book, written by Google engineers, is practical, engaging, and easy to follow. Through diverse examples featuring text analysis, speech processing, image recognition, and self-learning game AI, you’ll master all the basics of deep learning and explore advanced concepts, like retraining existing models for transfer learning and image generation. What's inside • Image and language processing in the browser • Tuning ML models with client-side data • Text and image creation with generative deep learning • Source code samples to test and modify About the Reader For JavaScript programmers interested in deep learning. About the Author Shanging Cai, Stanley Bileschi and Eric D. Nielsen are software engineers with experience on the Google Brain team, and were crucial to the development of the high-level API of TensorFlow.js. This book is based in part on t

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on guide for JavaScript developers to build and train deep learning models directly in the browser or on Node.js using TensorFlow.js, covering everything from linear regression to generative AI with practical, web-native examples. 【Book Arc】 - **Opening (~0%–9%)**: Introduces the "deep-learning revolution" and positions TensorFlow.js as a portable, production-ready alternative to Python-based ML. It explains why JavaScript is a viable platform for AI, covering the relationship between AI, machine learning, and neural networks, and previews the book's structure and goals. - **Early (~9%–25%)**: Lays the foundational concepts of tensors, data handling, and the first end-to-end example—simple linear regression. It walks through creating training/test datasets, defining a model, and understanding the core training loop, including gradient descent and loss surfaces, using a download-time prediction problem. - **Early (~25%–34%)**: Expands to multi-feature regression with the Boston Housing dataset. This stage covers data normalization, using `Model.fit()` callbacks for UI updates, and introduces key TensorFlow.js APIs like `tf.train.sgd()` with custom learning rates, plus tensor operations like broadcasting. - **Middle (~38%–47%)**: Introduces nonlinearity as the key to unlocking neural networks' representational power. It explains hyperparameters (units, activations, initializers) and dives into binary classification with a phishing-detection example, covering metrics like precision, recall, ROC curves, and binary cross-entropy loss. - **Middle (~47%–end of excerpts)**: Continues classification topics, showing how to tune decision thresholds on sigmoid outputs and interpret training results. The excerpts also hint at multiclass classification (softmax, categorical cross-entropy, confusion matrices) and more advanced topics like transfer learning and generative models, though these are not fully covered in the sample. 【Key Takeaways】 - **JavaScript is a first-class platform for deep learning** (Opening): TensorFlow.js brings production-quality ML to any environment where JavaScript runs, from browsers to Node backends, enabling real-time, client-side AI without Python dependencies. This matters for web developers who want to add intelligence to their apps without a separate ML stack. - **GPUs accelerate neural networks via SIMD parallelism** (Early): The book explains how WebGL leverages GPU's parallel processing (Single Instruction Multiple Data) to outperform CPUs on the massive element-wise operations in deep learning, making browser-based training feasible. This is crucial for understanding performance trade-offs. - **The training loop is the heart of deep learning** (Early): Using a simple linear regression example, the book dissects `Model.fit()`, showing the iterative cycle of forward pass, loss computation, gradient calculation, and weight updates. This demystifies gradient descent and provides a mental model for all later models. - **Data splitting is non-negotiable** (Early): The authors emphasize separating training and test sets to avoid "taking a test after seeing the answers," preventing models from merely memorizing data. This foundational practice ensures models generalize to unseen data. - **Nonlinearity is what makes neural networks powerful** (Middle): Adding hidden layers with nonlinear activations (like ReLU) allows models to learn complex, non-linear mappings beyond simple weighted sums, dramatically improving accuracy on real-world problems like the Boston Housing dataset. - **Hyperparameters require deliberate tuning** (Middle): Choices like the number of units, kernel initializers, and activation functions are hyperparameters that must be tuned experimentally, distinct from weights learned during training. The book shows this is an iterative process of trial and error. - **Classification metrics tell a nuanced story** (Middle): For binary classification (phishing detection), accuracy alone is insufficient. The book introduces precision, recall, ROC curves, and AUC, showing how adjusting the decision threshold on sigmoid outputs trades off between false positives and false negatives. 【Reading Tips】 - **Skim the early chapters (1–2) for concepts, but deep-read the code**: The first chapters establish theory (AI vs. ML, GPU parallelism) and the first regression example. Focus on understanding the `Model.fit()` loop and data handling; the code listings are more valuable than the prose. - **Pay close attention to Chapter 3's classification metrics**: This is where the book gets practical about evaluating models. The phishing-detection example is excellent for understanding precision/recall trade-offs and threshold tuning—don't skim this section. - **Treat the Boston Housing example as a template**: It's a complete, multi-feature regression project that introduces normalization and custom optimizers. Use it as a reference for your own projects, as it shows the full workflow from data prep to model evaluation. - **Be prepared for a fast pace**: The book assumes JavaScript familiarity and moves quickly. If you're new to deep learning, read the "what this chapter covers" boxes and the summaries at each section's end to stay oriented. - **Run the code as you go**: The examples are designed to be modified. Set up the Yarn/Parcel environment early and experiment with hyperparameters (units, learning rate) to internalize how they affect training curves and final metrics. 【Coverage Limits】 This guide covers the book's opening through the middle sections (roughly 0–47%), focusing on fundamentals, regression, and binary classification. The excerpts do not cover later chapters on convolutional networks, transfer learning, generative models, or reinforcement learning, which are mentioned in the book's blurb but not present in the sample material.
Excerpt 1
t programmers interested in deep learning. About the Author Shanging Cai, Stanley Bileschi and Eric D. Nielsen are software engineers with experience on the...
View in text
Excerpt 2
Us are capable of certain levels of SIMD instructions, too. However, a GPU comes with a much greater number of processing units (on the order of hundreds or...
View in text
Excerpt 3
UI while training. 2.3.1 The Boston Housing Prices dataset The Boston Housing Prices dataset4 is a collection of 500 simple real-estate records collected in...
View in text
Excerpt 4
nd at least X% of the posi- tives? For example, in figure 3.5, we see that after 400 epochs of training, our phishing-detection model is able to achieve a pr...
View in text
Excerpt 5
image. Moreover, these features are not handcrafted but are instead extracted from the data in an automatic fashion through supervised learning. This is a qu...
View in text
Excerpt 6
from Python Keras into the TensorFlow .js format TensorFlow.js features a high degree of compatibility and interoperability with Keras, one of the most popul...
View in text
Excerpt 7
t neighbors (kNN, see info box 5.2) classifi- ers possible Create a new model that con- • Applicable to transfer-learning • Internal activations (embed- tain...
View in text
Excerpt 8
It is very important that the data is shuffled the same way when we are taking the samples, so we don’t end up with the same example in both sets; thus we us...
View in text
Tags
AI categories
JavaScriptAIProgramming
ISBN: 1617296171
Publish Year: 2020
Language: English
Pages: 350
File Format: PDF
File Size: 12.6 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…