Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Training Loss and Validation Loss in Deep Learning

Would you please guide me how to interpret the following results?

1) loss < validation_loss 2) loss > validation_loss

It seems that the training loss always should be less than validation loss. But, both of these cases happen when training a model.

like image 553
Mohsen Haghaieghshenasfard Avatar asked Jan 12 '18 12:01

Mohsen Haghaieghshenasfard


2 Answers

Really a fundamental question in machine learning.

If validation loss >> training loss you can call it overfitting.
If validation loss  > training loss you can call it some overfitting.
If validation loss  < training loss you can call it some underfitting.
If validation loss << training loss you can call it underfitting.

Your aim is to make the validation loss as low as possible. Some overfitting is nearly always a good thing. All that matters in the end is: is the validation loss as low as you can get it.

This often occurs when the training loss is quite a bit lower.

Also check how to prevent overfitting.

enter image description here

like image 156
prosti Avatar answered Oct 21 '22 17:10

prosti


In machine learning and deep learning there are basically three cases

1) Underfitting

This is the only case where loss > validation_loss, but only slightly, if loss is far higher than validation_loss, please post your code and data so that we can have a look at

2) Overfitting

loss << validation_loss

This means that your model is fitting very nicely the training data but not at all the validation data, in other words it's not generalizing correctly to unseen data

3) Perfect fitting

loss == validation_loss

If both values end up to be roughly the same and also if the values are converging (plot the loss over time) then chances are very high that you are doing it right

like image 37
Romeo Kienzler Avatar answered Oct 21 '22 17:10

Romeo Kienzler