From 79fedac88182994b2c3a45992dff3f2bf8afc7c7 Mon Sep 17 00:00:00 2001 From: patrick Date: Thu, 14 Nov 2019 21:27:03 +0100 Subject: [PATCH 1/7] remove hardcoded values for recall-precision-threshold intersection --- 03_classification.ipynb | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/03_classification.ipynb b/03_classification.ipynb index 0e7545d..0717be2 100644 --- a/03_classification.ipynb +++ b/03_classification.ipynb @@ -484,14 +484,20 @@ " plt.grid(True) # Not shown\n", " plt.axis([-50000, 50000, 0, 1]) # Not shown\n", "\n", - "plt.figure(figsize=(8, 4)) # Not shown\n", + "\n", + "\n", + "recall_90_precision = recalls[np.argmax(precisions >= 0.90)]\n", + "threshold_90_precision = thresholds[np.argmax(precisions >= 0.90)]\n", + "\n", + "\n", + "plt.figure(figsize=(8, 4)) # Not shown\n", "plot_precision_recall_vs_threshold(precisions, recalls, thresholds)\n", - "plt.plot([7813, 7813], [0., 0.9], \"r:\") # Not shown\n", - "plt.plot([-50000, 7813], [0.9, 0.9], \"r:\") # Not shown\n", - "plt.plot([-50000, 7813], [0.4368, 0.4368], \"r:\")# Not shown\n", - "plt.plot([7813], [0.9], \"ro\") # Not shown\n", - "plt.plot([7813], [0.4368], \"ro\") # Not shown\n", - "save_fig(\"precision_recall_vs_threshold_plot\") # Not shown\n", + "plt.plot([threshold_90_precision, threshold_90_precision], [0., 0.9], \"r:\") # Not shown\n", + "plt.plot([-50000, threshold_90_precision], [0.9, 0.9], \"r:\") # Not shown\n", + "plt.plot([-50000, threshold_90_precision], [recall_90_precision, recall_90_precision], \"r:\")# Not shown\n", + "plt.plot([threshold_90_precision], [0.9], \"ro\") # Not shown\n", + "plt.plot([threshold_90_precision], [recall_90_precision], \"ro\") # Not shown\n", + "save_fig(\"precision_recall_vs_threshold_plot\") # Not shown\n", "plt.show()" ] }, From de450d8077437114273ba45ff9839f1e30be06ad Mon Sep 17 00:00:00 2001 From: Fai Sharji Date: Wed, 25 Dec 2019 23:00:26 -0500 Subject: [PATCH 2/7] Update 11_training_deep_neural_networks.ipynb Swapped the Activation and BatchNormalization lines in order to make the code consistent with the description and the book (p. 343), i.e. adding the BN layers BEFORE the activation function. --- 11_training_deep_neural_networks.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/11_training_deep_neural_networks.ipynb b/11_training_deep_neural_networks.ipynb index 5ad951f..f80db42 100644 --- a/11_training_deep_neural_networks.ipynb +++ b/11_training_deep_neural_networks.ipynb @@ -715,8 +715,8 @@ " keras.layers.BatchNormalization(),\n", " keras.layers.Activation(\"relu\"),\n", " keras.layers.Dense(100, use_bias=False),\n", - " keras.layers.Activation(\"relu\"),\n", " keras.layers.BatchNormalization(),\n", + " keras.layers.Activation(\"relu\"),\n", " keras.layers.Dense(10, activation=\"softmax\")\n", "])" ] From d4bc8b07c74758d77148e2cfe2f06958cec5a243 Mon Sep 17 00:00:00 2001 From: vasili111 Date: Tue, 7 Jan 2020 11:21:50 -0600 Subject: [PATCH 3/7] clarification of which inverse Currently is says "inverse" which can be confused with additive inverse I think it is better to specify that we are talking here about "multiplicative inverse" which is also "reciprocal". --- math_linear_algebra.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math_linear_algebra.ipynb b/math_linear_algebra.ipynb index e281e26..264289a 100644 --- a/math_linear_algebra.ipynb +++ b/math_linear_algebra.ipynb @@ -525,7 +525,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "As you might guess, dividing a vector by a scalar is equivalent to multiplying by its inverse:\n", + "As you might guess, dividing a vector by a scalar is equivalent to multiplying by its multiplicative inverse (reciprocal):\n", "\n", "$\\dfrac{\\textbf{u}}{\\lambda} = \\dfrac{1}{\\lambda} \\times \\textbf{u}$" ] From c0dea2c05390dbf89f50cc5cbd383e95a2f0128a Mon Sep 17 00:00:00 2001 From: vasili111 Date: Wed, 8 Jan 2020 10:20:38 -0600 Subject: [PATCH 4/7] minor grammar ("matric" to "matrix") --- math_linear_algebra.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math_linear_algebra.ipynb b/math_linear_algebra.ipynb index e281e26..fa1c168 100644 --- a/math_linear_algebra.ipynb +++ b/math_linear_algebra.ipynb @@ -1062,7 +1062,7 @@ " Q_{m1} + R_{m1} & Q_{m2} + R_{m2} & Q_{m3} + R_{m3} & \\cdots & Q_{mn} + R_{mn} \\\\\n", "\\end{bmatrix}$\n", "\n", - "For example, let's create a $2 \\times 3$ matric $B$ and compute $A + B$:" + "For example, let's create a $2 \\times 3$ matrix $B$ and compute $A + B$:" ] }, { From 6c551c79616ce7f6d3fea99ebf2e0bcbf581c0a3 Mon Sep 17 00:00:00 2001 From: Adarsh Nair <51357266+ada-nai@users.noreply.github.com> Date: Fri, 31 Jan 2020 12:54:26 +0530 Subject: [PATCH 5/7] Spelling change in INSTALL.md defaut -> default in # Start Jupyter section --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 25a4991..fc5bc34 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -45,7 +45,7 @@ If you're on Windows, and you want to go through chapter 18 on Reinforcement Lea ## Start Jupyter -You're almost there! You just need to register the `tf2` conda environment to Jupyter. The notebooks in this project will defaut to the environment named `python3`, so it's best to register this environment using the name `python3` (if you prefer to use another name, you will have to select it in the "Kernel > Change kernel..." menu in Jupyter every time you open a notebook): +You're almost there! You just need to register the `tf2` conda environment to Jupyter. The notebooks in this project will default to the environment named `python3`, so it's best to register this environment using the name `python3` (if you prefer to use another name, you will have to select it in the "Kernel > Change kernel..." menu in Jupyter every time you open a notebook): $ python3 -m ipykernel install --user --name=python3 From 3d6e42e87f18630f4eb647ce99eaf892ccfa587a Mon Sep 17 00:00:00 2001 From: ada-nai Date: Fri, 31 Jan 2020 13:42:15 +0530 Subject: [PATCH 6/7] updated chapter 01 --- 01_the_machine_learning_landscape.ipynb | 104 +++++++----------------- 1 file changed, 31 insertions(+), 73 deletions(-) diff --git a/01_the_machine_learning_landscape.ipynb b/01_the_machine_learning_landscape.ipynb index 710f2cf..b7418ba 100644 --- a/01_the_machine_learning_landscape.ipynb +++ b/01_the_machine_learning_landscape.ipynb @@ -170,27 +170,6 @@ "print(model.predict(X_new)) # outputs [[ 5.96242338]]" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "markdown", "metadata": {}, @@ -198,27 +177,6 @@ "# Note: you can ignore the rest of this notebook, it just generates many of the figures in chapter 1." ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "markdown", "metadata": {}, @@ -280,7 +238,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -292,7 +250,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -315,7 +273,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -328,7 +286,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -339,7 +297,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -348,7 +306,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -361,7 +319,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -387,7 +345,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -396,7 +354,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -405,7 +363,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -430,7 +388,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -445,7 +403,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -462,7 +420,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ @@ -474,7 +432,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ @@ -494,7 +452,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 23, "metadata": {}, "outputs": [], "source": [ @@ -503,7 +461,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 24, "metadata": {}, "outputs": [], "source": [ @@ -512,7 +470,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 25, "metadata": {}, "outputs": [], "source": [ @@ -533,7 +491,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ @@ -570,7 +528,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 27, "metadata": {}, "outputs": [], "source": [ @@ -579,7 +537,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ @@ -588,7 +546,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 29, "metadata": {}, "outputs": [], "source": [ @@ -605,7 +563,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ @@ -637,7 +595,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 31, "metadata": {}, "outputs": [], "source": [ @@ -662,7 +620,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 32, "metadata": {}, "outputs": [], "source": [ @@ -671,7 +629,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 33, "metadata": {}, "outputs": [], "source": [ @@ -680,7 +638,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 34, "metadata": {}, "outputs": [], "source": [ @@ -712,7 +670,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 35, "metadata": {}, "outputs": [], "source": [ @@ -724,7 +682,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 36, "metadata": {}, "outputs": [], "source": [ @@ -735,7 +693,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 37, "metadata": {}, "outputs": [], "source": [ @@ -746,7 +704,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 38, "metadata": {}, "outputs": [], "source": [ @@ -785,7 +743,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.3" + "version": "3.7.6" }, "nav_menu": {}, "toc": { From 236dc8724977af72689b1a24e9b952db803e9268 Mon Sep 17 00:00:00 2001 From: ada-nai Date: Fri, 31 Jan 2020 14:33:25 +0530 Subject: [PATCH 7/7] Revert "updated chapter 01" This reverts commit 3d6e42e87f18630f4eb647ce99eaf892ccfa587a. --- 01_the_machine_learning_landscape.ipynb | 104 +++++++++++++++++------- 1 file changed, 73 insertions(+), 31 deletions(-) diff --git a/01_the_machine_learning_landscape.ipynb b/01_the_machine_learning_landscape.ipynb index b7418ba..710f2cf 100644 --- a/01_the_machine_learning_landscape.ipynb +++ b/01_the_machine_learning_landscape.ipynb @@ -170,6 +170,27 @@ "print(model.predict(X_new)) # outputs [[ 5.96242338]]" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "markdown", "metadata": {}, @@ -177,6 +198,27 @@ "# Note: you can ignore the rest of this notebook, it just generates many of the figures in chapter 1." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "markdown", "metadata": {}, @@ -238,7 +280,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -250,7 +292,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -273,7 +315,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -286,7 +328,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -297,7 +339,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -306,7 +348,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -319,7 +361,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -345,7 +387,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -354,7 +396,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -363,7 +405,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -388,7 +430,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -403,7 +445,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ @@ -420,7 +462,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ @@ -432,7 +474,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 23, "metadata": {}, "outputs": [], "source": [ @@ -452,7 +494,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 24, "metadata": {}, "outputs": [], "source": [ @@ -461,7 +503,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 25, "metadata": {}, "outputs": [], "source": [ @@ -470,7 +512,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ @@ -491,7 +533,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 27, "metadata": {}, "outputs": [], "source": [ @@ -528,7 +570,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ @@ -537,7 +579,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 29, "metadata": {}, "outputs": [], "source": [ @@ -546,7 +588,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ @@ -563,7 +605,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 31, "metadata": {}, "outputs": [], "source": [ @@ -595,7 +637,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 32, "metadata": {}, "outputs": [], "source": [ @@ -620,7 +662,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 33, "metadata": {}, "outputs": [], "source": [ @@ -629,7 +671,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 34, "metadata": {}, "outputs": [], "source": [ @@ -638,7 +680,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 35, "metadata": {}, "outputs": [], "source": [ @@ -670,7 +712,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 36, "metadata": {}, "outputs": [], "source": [ @@ -682,7 +724,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 37, "metadata": {}, "outputs": [], "source": [ @@ -693,7 +735,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 38, "metadata": {}, "outputs": [], "source": [ @@ -704,7 +746,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 39, "metadata": {}, "outputs": [], "source": [ @@ -743,7 +785,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.7.3" }, "nav_menu": {}, "toc": {