Summary
This has been a very practical chapter, showing one way to proceed when training a neural network. We started from a big model, achieving 69.7% validation accuracy, and then we reduced its size and added some layers to increase the number of non-linear activations. We used batch normalization to equalize the contribution of all the channels and then we learned about early stopping, which helped us to decide when to stop the training.
After learning how to automatically stop the training, we applied it immediately with data augmentation, which increases not only the size of the dataset but also the number of epochs required to properly train the network. We then introduced Dropout
and SpatialDropout2D
, a powerful way to reduce overfitting, though not always easy to use.
We ended up with a network achieving 87.8% accuracy.
In the next chapter, we will train a neural network that will be able to drive a car on an empty track!