Skip to content

Commit 60e4956

Browse files
committed
Update all notebooks
1 parent a39702b commit 60e4956

20 files changed

+275
-241
lines changed

chapter02_mathematical-building-blocks.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@
383383
"colab_type": "text"
384384
},
385385
"source": [
386-
"### Rank-3 tensors and higher-rank tensors"
386+
"### Rank-3 and higher-rank tensors"
387387
]
388388
},
389389
{
@@ -1028,7 +1028,7 @@
10281028
"colab_type": "text"
10291029
},
10301030
"source": [
1031-
"### Chaining derivatives: the Backpropagation algorithm"
1031+
"### Chaining derivatives: The Backpropagation algorithm"
10321032
]
10331033
},
10341034
{
@@ -1055,7 +1055,7 @@
10551055
"colab_type": "text"
10561056
},
10571057
"source": [
1058-
"#### The Gradient Tape in TensorFlow"
1058+
"#### The gradient tape in TensorFlow"
10591059
]
10601060
},
10611061
{
@@ -1337,7 +1337,7 @@
13371337
"learning_rate = 1e-3\n",
13381338
"\n",
13391339
"def update_weights(gradients, weights):\n",
1340-
" for g, w in zip(gradients, model.weights):\n",
1340+
" for g, w in zip(gradients, weights):\n",
13411341
" w.assign_sub(g * learning_rate)"
13421342
]
13431343
},
@@ -1434,7 +1434,7 @@
14341434
"colab_type": "text"
14351435
},
14361436
"source": [
1437-
"## Chapter summary"
1437+
"## Summary"
14381438
]
14391439
}
14401440
],

chapter03_introduction-to-keras-and-tf.ipynb

+39-26
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"colab_type": "text"
4343
},
4444
"source": [
45-
"## Keras and TensorFlow: a brief history"
45+
"## Keras and TensorFlow: A brief history"
4646
]
4747
},
4848
{
@@ -60,7 +60,7 @@
6060
"colab_type": "text"
6161
},
6262
"source": [
63-
"### Jupyter notebooks: the preferred way to run deep-learning experiments"
63+
"### Jupyter notebooks: The preferred way to run deep-learning experiments"
6464
]
6565
},
6666
{
@@ -87,7 +87,7 @@
8787
"colab_type": "text"
8888
},
8989
"source": [
90-
"#### Installing packages with `pip`"
90+
"#### Installing packages with pip"
9191
]
9292
},
9393
{
@@ -114,7 +114,7 @@
114114
"colab_type": "text"
115115
},
116116
"source": [
117-
"#### Constant tensors and Variables"
117+
"#### Constant tensors and variables"
118118
]
119119
},
120120
{
@@ -212,7 +212,7 @@
212212
"colab_type": "text"
213213
},
214214
"source": [
215-
"**Creating a Variable**"
215+
"**Creating a TensorFlow variable**"
216216
]
217217
},
218218
{
@@ -233,7 +233,7 @@
233233
"colab_type": "text"
234234
},
235235
"source": [
236-
"**Assigning a value to a Variable**"
236+
"**Assigning a value to a TensorFlow variable**"
237237
]
238238
},
239239
{
@@ -253,7 +253,7 @@
253253
"colab_type": "text"
254254
},
255255
"source": [
256-
"**Assigning a value to a subset of a Variable**"
256+
"**Assigning a value to a subset of a TensorFlow variable**"
257257
]
258258
},
259259
{
@@ -273,7 +273,7 @@
273273
"colab_type": "text"
274274
},
275275
"source": [
276-
"**Using assign_add**"
276+
"**Using `assign_add`**"
277277
]
278278
},
279279
{
@@ -293,7 +293,7 @@
293293
"colab_type": "text"
294294
},
295295
"source": [
296-
"#### Tensor operations: doing math in TensorFlow"
296+
"#### Tensor operations: Doing math in TensorFlow"
297297
]
298298
},
299299
{
@@ -327,7 +327,7 @@
327327
"colab_type": "text"
328328
},
329329
"source": [
330-
"#### A second look at the `GradientTape` API"
330+
"#### A second look at the GradientTape API"
331331
]
332332
},
333333
{
@@ -336,7 +336,7 @@
336336
"colab_type": "text"
337337
},
338338
"source": [
339-
"**Using the GradientTape**"
339+
"**Using the `GradientTape`**"
340340
]
341341
},
342342
{
@@ -359,7 +359,7 @@
359359
"colab_type": "text"
360360
},
361361
"source": [
362-
"**Using the GradientTape with constant tensor inputs**"
362+
"**Using `GradientTape` with constant tensor inputs**"
363363
]
364364
},
365365
{
@@ -408,7 +408,7 @@
408408
"colab_type": "text"
409409
},
410410
"source": [
411-
"#### An end-to-end example: a linear classifier in pure TensorFlow"
411+
"#### An end-to-end example: A linear classifier in pure TensorFlow"
412412
]
413413
},
414414
{
@@ -430,9 +430,13 @@
430430
"source": [
431431
"num_samples_per_class = 1000\n",
432432
"negative_samples = np.random.multivariate_normal(\n",
433-
" mean=[0, 3], cov=[[1, 0.5],[0.5, 1]], size=num_samples_per_class)\n",
433+
" mean=[0, 3],\n",
434+
" cov=[[1, 0.5],[0.5, 1]],\n",
435+
" size=num_samples_per_class)\n",
434436
"positive_samples = np.random.multivariate_normal(\n",
435-
" mean=[3, 0], cov=[[1, 0.5],[0.5, 1]], size=num_samples_per_class)"
437+
" mean=[3, 0],\n",
438+
" cov=[[1, 0.5],[0.5, 1]],\n",
439+
" size=num_samples_per_class)"
436440
]
437441
},
438442
{
@@ -648,7 +652,7 @@
648652
"colab_type": "text"
649653
},
650654
"source": [
651-
"## Anatomy of a neural network: understanding core Keras APIs"
655+
"## Anatomy of a neural network: Understanding core Keras APIs"
652656
]
653657
},
654658
{
@@ -657,7 +661,7 @@
657661
"colab_type": "text"
658662
},
659663
"source": [
660-
"### Layers: the building blocks of deep learning"
664+
"### Layers: The building blocks of deep learning"
661665
]
662666
},
663667
{
@@ -666,7 +670,16 @@
666670
"colab_type": "text"
667671
},
668672
"source": [
669-
"#### The base `Layer` class in Keras"
673+
"#### The base Layer class in Keras"
674+
]
675+
},
676+
{
677+
"cell_type": "markdown",
678+
"metadata": {
679+
"colab_type": "text"
680+
},
681+
"source": [
682+
"**A `Dense` layer implemented as a `Layer` subclass**"
670683
]
671684
},
672685
{
@@ -720,7 +733,7 @@
720733
"colab_type": "text"
721734
},
722735
"source": [
723-
"#### Automatic shape inference: building layers on the fly"
736+
"#### Automatic shape inference: Building layers on the fly"
724737
]
725738
},
726739
{
@@ -782,7 +795,7 @@
782795
"colab_type": "text"
783796
},
784797
"source": [
785-
"### The \"compile\" step: configuring the learning process"
798+
"### The \"compile\" step: Configuring the learning process"
786799
]
787800
},
788801
{
@@ -827,7 +840,7 @@
827840
"colab_type": "text"
828841
},
829842
"source": [
830-
"### Understanding the `fit` method"
843+
"### Understanding the fit() method"
831844
]
832845
},
833846
{
@@ -836,7 +849,7 @@
836849
"colab_type": "text"
837850
},
838851
"source": [
839-
"**Calling `fit` with NumPy data**"
852+
"**Calling `fit()` with NumPy data**"
840853
]
841854
},
842855
{
@@ -872,7 +885,7 @@
872885
"colab_type": "text"
873886
},
874887
"source": [
875-
"### Monitoring loss & metrics on validation data"
888+
"### Monitoring loss and metrics on validation data"
876889
]
877890
},
878891
{
@@ -881,7 +894,7 @@
881894
"colab_type": "text"
882895
},
883896
"source": [
884-
"**Using the validation data argument**"
897+
"**Using the `validation_data` argument**"
885898
]
886899
},
887900
{
@@ -921,7 +934,7 @@
921934
"colab_type": "text"
922935
},
923936
"source": [
924-
"### Inference: using a model after training"
937+
"### Inference: Using a model after training"
925938
]
926939
},
927940
{
@@ -942,7 +955,7 @@
942955
"colab_type": "text"
943956
},
944957
"source": [
945-
"## Chapter summary"
958+
"## Summary"
946959
]
947960
}
948961
],

chapter04_getting-started-with-neural-networks.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"colab_type": "text"
1616
},
1717
"source": [
18-
"# Getting started with neural networks: classification and regression"
18+
"# Getting started with neural networks: Classification and regression"
1919
]
2020
},
2121
{
@@ -24,7 +24,7 @@
2424
"colab_type": "text"
2525
},
2626
"source": [
27-
"## Classifying movie reviews: a binary classification example"
27+
"## Classifying movie reviews: A binary classification example"
2828
]
2929
},
3030
{
@@ -445,7 +445,7 @@
445445
"colab_type": "text"
446446
},
447447
"source": [
448-
"## Classifying newswires: a multiclass classification example"
448+
"## Classifying newswires: A multiclass classification example"
449449
]
450450
},
451451
{
@@ -994,7 +994,7 @@
994994
"colab_type": "text"
995995
},
996996
"source": [
997-
"## Predicting house prices: a regression example"
997+
"## Predicting house prices: A regression example"
998998
]
999999
},
10001000
{
@@ -1378,7 +1378,7 @@
13781378
"colab_type": "text"
13791379
},
13801380
"source": [
1381-
"## Chapter summary"
1381+
"## Summary"
13821382
]
13831383
}
13841384
],

chapter05_fundamentals-of-ml.ipynb

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"colab_type": "text"
2525
},
2626
"source": [
27-
"## Generalization: the goal of machine learning"
27+
"## Generalization: The goal of machine learning"
2828
]
2929
},
3030
{
@@ -699,9 +699,9 @@
699699
},
700700
"outputs": [],
701701
"source": [
702-
"from\u00a0keras\u00a0import\u00a0regularizers\n",
702+
"from tensorflow.keras import regularizers\n",
703703
"regularizers.l1(0.001)\n",
704-
"regularizers.l1_l2(l1=0.001,\u00a0l2=0.001)"
704+
"regularizers.l1_l2(l1=0.001, l2=0.001)"
705705
]
706706
},
707707
{
@@ -751,7 +751,7 @@
751751
"colab_type": "text"
752752
},
753753
"source": [
754-
"## Chapter summary"
754+
"## Summary"
755755
]
756756
}
757757
],

0 commit comments

Comments
 (0)