fchollet / deep-learning-with-python-notebooks

Jupyter notebooks for the code samples of the book "Deep Learning with Python"
MIT License
18.13k stars 8.52k forks source link

[4.4-overfitting] which model is better? (original model vs L2-regularized model) #57

Open songlinhit opened 6 years ago

songlinhit commented 6 years ago

image This example illustrates the impact of L2 regulation. I can see that the L2-regularied model gets overfitting slowly comparing with the original model. But the peak of validation loss of L2-regularied model is greater than that of the original model. Thus, for this example, the original model is still better than L2-regulaized model, right?

RorisangSitoboli commented 4 years ago

I see that the validation loss profile for the L2 regularized model peaks at around 0.4 in the figure while the standard model peaks at 0.8. The validation loss axis (y axis) is in positive units. From the plot you can also tell that both models start overfitting at 2.5 epochs but the standard model clearly performs poorly (far steeper gradient) after that compared to the regularized model. This must mean the regularized model performs far better.