liveBook · Manning

Validation loss

As explained in Deep Learning with PyTorch, Second Edition

Loss computed on held-out validation data.

Validation loss measures how poorly a model performs on held-out data that it did not use for training. It shows whether improvements on training samples generalize to unseen samples. section 5.5.3

Compare validation loss with training loss to interpret learning:

  • If both losses decrease together, the model is learning and generalizing. section 5.5.3
  • If training loss decreases while validation loss increases, the model is overfitting. section 5.5.3
  • If neither loss decreases, the data may lack useful information or the model may have insufficient capacity. section 5.5.3

Evaluating each training epoch

Split the data into training and validation subsets, compute validation predictions with the current model parameters, and evaluate them with the same loss function. Print both values to monitor their trends.

How Deep Learning with PyTorch, Second Edition covers it

How deep it goes
Defines the metric, compares its trend with training loss, and demonstrates epoch-by-epoch computation without detailing loss-function internals.
Examples
Uses randomized dataset splitting, separate tensors, a PyTorch training loop, and four conceptual loss-curve patterns.
What you can do after
Diagnose overfitting and generalization by monitoring training and validation losses during optimization.
How it connects
Connects validation loss to training loss, validation sets, overfitting, generalization, and regularization.

Also explained in

Compare how 5 books explain validation loss →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with PyTorch, Second Edition. The section links point to the parts of the book it draws on.