From ede46d7415f56443d232e0ee2f413220893374e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Fri, 5 May 2017 15:56:13 +0200 Subject: [PATCH] Add 2 comments in the solution of exercise 9, chapter 13 --- 13_convolutional_neural_networks.ipynb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/13_convolutional_neural_networks.ipynb b/13_convolutional_neural_networks.ipynb index 4bb5a03..872356b 100644 --- a/13_convolutional_neural_networks.ipynb +++ b/13_convolutional_neural_networks.ipynb @@ -1367,6 +1367,13 @@ " return image.astype(np.float32) / 255" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note: at test time, the preprocessing step should be as light as possible, just the bare minimum necessary to be able to feed the image to the neural network. You may want to tweak the above function to add a `training` parameter: if `False`, preprocessing should be limited to the bare minimum (i.e., no flipping the image, and just the minimum cropping required, preserving the center of the image)." + ] + }, { "cell_type": "markdown", "metadata": { @@ -2150,6 +2157,13 @@ " print(\"Test accuracy:\", acc_test)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Okay, 68% accuracy is not great (in fact, it's really bad), but this is only after 10 epochs, and freezing all layers except for the output layer. If you have a GPU, you can try again and let training run for much longer (e.g., using early stopping to decide when to stop). You can also improve the image preprocessing function to make more tweaks to the image (e.g., changing the brightness and hue, rotate the image slightly). You can reach above 95% accuracy on this task. If you want to dig deeper, this [great blog post](https://kwotsin.github.io/tech/2017/02/11/transfer-learning.html) goes into more details and reaches 96% accuracy." + ] + }, { "cell_type": "markdown", "metadata": {