From lesson 1 we have:
If you try training for more epochs, you’ll notice that we start to overfit, which means that our model is learning to recognize the specific images in the training set, rather than generalizing such that we also get good results on the validation set.
So, I took the 3 lines of code and ran for 50 epochs and got the following:
arch=resnet34
data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz))
learn = ConvLearner.pretrained(arch, data, precompute=True)
learn.fit(0.01, 50)
Two things I observe from this graph about over-fitting are:
- The training loss keeps decreasing after every epoch. Our model is learning to recognize the specific images in the training set.
- The validation loss keeps increasing after every epoch. Our model is not generalizing well enough on the validation set.
After 250 epochs
The trend is so clear with lots of epochs!