Add 2 comments in the solution of exercise 9, chapter 13

main
Aurélien Geron 2017-05-05 15:56:13 +02:00
parent d74dfd0571
commit ede46d7415
1 changed files with 14 additions and 0 deletions

View File

@ -1367,6 +1367,13 @@
" return image.astype(np.float32) / 255" " 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", "cell_type": "markdown",
"metadata": { "metadata": {
@ -2150,6 +2157,13 @@
" print(\"Test accuracy:\", acc_test)" " 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", "cell_type": "markdown",
"metadata": { "metadata": {