基本信息
源码名称:Deep.Learning.with.JavaScript.pdf
源码大小:17.58M
文件格式:.pdf
开发语言:js
更新时间:2020-04-27
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

brief contents
PART 1 MOTIVATION AND BASIC CONCEPTS. .................................1
1 ■ Deep learning and JavaScript 3
PART 2 A GENTLE INTRODUCTION TO TENSORFLOW.JS . ............. 35
2 ■ Getting started: Simple linear regression in TensorFlow.js 37
3 ■ Adding nonlinearity: Beyond weighted sums 79
4 ■ Recognizing images and sounds using convnets 117
5 ■ Transfer learning: Reusing pretrained neural networks 152
PART 3 ADVANCED DEEP LEARNING WITH TENSORFLOW.JS. ....... 199
6 ■ Working with data 201
7 ■ Visualizing data and models 246
8 ■ Underfitting, overfitting, and the universal workflow
of machine learning 273
9 ■ Deep learning for sequences and text 292
10 ■ Generative deep learning 334
11 ■ Basics of deep reinforcement learning 371
PART 4 SUMMARY AND CLOSING WORDS . .................................. 415
12 ■ Testing, optimizing, and deploying models 417
13 ■ Summary, conclusions, and beyond 453

vii
contents
foreword xiii
preface xv
acknowledgments xvii
about this book xix
about the authors xxii
about the cover illustration xxiii
PART 1 MOTIVATION AND BASIC CONCEPTS....................1
1 Deep learning and JavaScript 3
1.1 Artificial intelligence, machine learning, neural networks,
and deep learning 6
Artificial intelligence 6 ■ Machine learning: How it differs from
traditional programming 7 ■ Neural networks and deep
learning 12 ■ Why deep learning? Why now? 16
1.2 Why combine JavaScript and machine learning? 18
Deep learning with Node.js 24 ■ The JavaScript ecosystem 25
1.3 Why TensorFlow.js? 27
A brief history of TensorFlow, Keras, and TensorFlow.js 27 ■ Why
TensorFlow.js: A brief comparison with similar libraries 31 ■ How
is TensorFlow.js being used by the world? 31 ■ What this book will
and will not teach you about TensorFlow.js 32
viii CONTENTS
PART 2 A GENTLE INTRODUCTION TO
TENSORFLOW.JS ..............................................35
2 Getting started: Simple linear regression in TensorFlow.js 37
2.1 Example 1: Predicting the duration of a download using
TensorFlow.js 38
Project overview: Duration prediction 38 ■ A note on code listings
and console interactions 39 ■ Creating and formatting the
data 40 ■ Defining a simple model 43 ■ Fitting the model
to the training data 46 ■ Using our trained model to make
predictions 48 ■ Summary of our first example 49
2.2 Inside Model.fit(): Dissecting gradient descent
from example 1 50
The intuitions behind gradient-descent optimization 50
Backpropagation: Inside gradient descent 56
2.3 Linear regression with multiple input features 59
The Boston Housing Prices dataset 60 ■ Getting and running the
Boston-housing project from GitHub 61 ■ Accessing the Bostonhousing data 63 ■ Precisely defining the Boston-housing
problem 65 ■ A slight diversion into data normalization 66
Linear regression on the Boston-housing data 70
2.4 How to interpret your model 74
Extracting meaning from learned weights 74 ■ Extracting internal
weights from the model 75 ■ Caveats on interpretability 77
3 Adding nonlinearity: Beyond weighted sums 79
3.1 Nonlinearity: What it is and what it is good for 80
Building the intuition for nonlinearity in neural networks 82
Hyperparameters and hyperparameter optimization 89
3.2 Nonlinearity at output: Models for classification 92
What is binary classification? 92 ■ Measuring the quality of
binary classifiers: Precision, recall, accuracy, and ROC curves 96
The ROC curve: Showing trade-offs in binary classification 99
Binary cross entropy: The loss function for binary classification 103
3.3 Multiclass classification 106
One-hot encoding of categorical data 107 ■ Softmax
activation 109 ■ Categorical cross entropy: The loss function
for multiclass classification 111 ■ Confusion matrix: Fine-grained
analysis of multiclass classification 113
CONTENTS ix
4 Recognizing images and sounds using convnets 117
4.1 From vectors to tensors: Representing images 118
The MNIST dataset 119
4.2 Your first convnet 120
conv2d layer 122 ■ maxPooling2d layer 126 ■ Repeating
motifs of convolution and pooling 127 ■ Flatten and dense
layers 128 ■ Training the convnet 130 ■ Using a convnet to
make predictions 134
4.3 Beyond browsers: Training models faster using
Node.js 137
Dependencies and imports for using tfjs-node 137 ■ Saving the
model from Node.js and loading it in the browser 142
4.4 Spoken-word recognition: Applying convnets on
audio data 144
Spectrograms: Representing sounds as images 145
5 Transfer learning: Reusing pretrained neural networks 152
5.1 Introduction to transfer learning: Reusing pretrained
models 153
Transfer learning based on compatible output shapes: Freezing
layers 155 ■ Transfer learning on incompatible output shapes:
Creating a new model using outputs from the base model 161
Getting the most out of transfer learning through fine-tuning: An
audio example 174
5.2 Object detection through transfer learning on a
convnet 185
A simple object-detection problem based on synthesized scenes 186
Deep dive into simple object detection 187
PART 3 ADVANCED DEEP LEARNING WITH
TENSORFLOW.JS ............................................199
6 Working with data 201
6.1 Using tf.data to manage data 202
The tf.data.Dataset object 203 ■ Creating a tf.data.Dataset 203
Accessing the data in your dataset 209 ■ Manipulating tfjs-data
datasets 210
6.2 Training models with model.fitDataset 214
x CONTENTS
6.3 Common patterns for accessing data 220
Working with CSV format data 220 ■ Accessing video data using
tf.data.webcam() 225 ■ Accessing audio data using
tf.data.microphone() 228
6.4 Your data is likely flawed: Dealing with problems
in your data 230
Theory of data 231 ■ Detecting and cleaning problems with
data 235
6.5 Data augmentation 242
7 Visualizing data and models 246
7.1 Data visualization 247
Visualizing data using tfjs-vis 247 ■ An integrative case study:
Visualizing weather data with tfjs-vis 255
7.2 Visualizing models after training 260
Visualizing the internal activations of a convnet 262
Visualizing what convolutional layers are sensitive to: Maximally
activating images 265 ■ Visual interpretation of a convnet’s
classification result 269
8 Underfitting, overfitting, and the universal workflow
of machine learning 273
8.1 Formulation of the temperature-prediction problem 274
8.2 Underfitting, overfitting, and countermeasures 278
Underfitting 278 ■ Overfitting 280 ■ Reducing overfitting
with weight regularization and visualizing it working 282
8.3 The universal workflow of machine learning 287
9 Deep learning for sequences and text 292
9.1 Second attempt at weather prediction:
Introducing RNNs 294
Why dense layers fail to model sequential order 294 ■ How RNNs
model sequential order 296
9.2 Building deep-learning models for text 305
How text is represented in machine learning: One-hot and multi-hot
encoding 306 ■ First attempt at the sentiment-analysis
problem 308 ■ A more efficient representation of text: Word
embeddings 310 ■ 1D convnets 312
CONTENTS xi
9.3 Sequence-to-sequence tasks with attention
mechanism 321
Formulation of the sequence-to-sequence task 321 ■ The encoderdecoder architecture and the attention mechanism 324 ■ Deep dive
into the attention-based encoder-decoder model 327
10 Generative deep learning 334
10.1 Generating text with LSTM 335
Next-character predictor: A simple way to generate text 335
The LSTM-text-generation example 337 ■ Temperature:
Adjustable randomness in the generated text 342
10.2 Variational autoencoders: Finding an efficient and
structured vector representation of images 345
Classical autoencoder and VAE: Basic ideas 345 ■ A detailed
example of VAE: The Fashion-MNIST example 349
10.3 Image generation with GANs 356
The basic idea behind GANs 357 ■ The building blocks of
ACGAN 360 ■ Diving deeper into the training of ACGAN 363
Seeing the MNIST ACGAN training and generation 366
11 Basics of deep reinforcement learning 371
11.1 The formulation of reinforcement-learning
problems 373
11.2 Policy networks and policy gradients: The cart-pole
example 376
Cart-pole as a reinforcement-learning problem 376 ■ Policy
network 378 ■ Training the policy network: The REINFORCE
algorithm 381
11.3 Value networks and Q-learning: The snake game
example 389
Snake as a reinforcement-learning problem 389 ■ Markov decision
process and Q-values 392 ■ Deep Q-network 396 ■ Training
the deep Q-network 399
PART 4 SUMMARY AND CLOSING WORDS .....................415
12 Testing, optimizing, and deploying models 417
12.1 Testing TensorFlow.js models 418
Traditional unit testing 419 ■ Testing with golden values 422
Considerations around continuous training 424
xii CONTENTS
12.2 Model optimization 425
Model-size optimization through post-training weight
quantization 426 ■ Inference-speed optimization using
GraphModel conversion 434
12.3 Deploying TensorFlow.js models on various platforms
and environments 439
Additional considerations when deploying to the web 439
Deployment to cloud serving 440 ■ Deploying to a browser
extension, like Chrome Extension 441 ■ Deploying TensorFlow.js
models in JavaScript-based mobile applications 443 ■ Deploying
TensorFlow.js models in JavaScript-based cross-platform desktop
applications 445 ■ Deploying TensorFlow.js models on WeChat
and other JavaScript-based mobile app plugin systems 447
Deploying TensorFlow.js models on single-board computers 448
Summary of deployments 450
13 Summary, conclusions, and beyond 453
13.1 Key concepts in review 454
Various approaches to AI 454 ■ What makes deep learning stand
out among the subfields of machine learning 455 ■ How to think
about deep learning at a high level 455 ■ Key enabling
technologies of deep learning 456 ■ Applications and
opportunities unlocked by deep learning in JavaScript 457
13.2 Quick overview of the deep-learning workflow
and algorithms in TensorFlow.js 458
The universal workflow of supervised deep learning 458
Reviewing model and layer types in TensorFlow.js: A quick
reference 460 ■ Using pretrained models from TensorFlow.js 465
The space of possibilities 468 ■ Limitations of deep learning 470
13.3 Trends in deep learning 473
13.4 Pointers for further exploration 474
Practice real-world machine-learning problems on Kaggle 474
Read about the latest developments on arXiv 475 ■ Explore the
TensorFlow.js Ecosystem 475
 appendix A Installing tfjs-node-gpu and its dependencies 477
appendix B A quick tutorial of tensors and operations in TensorFlow.js 482
glossary 507
index 519