Validation loss
The value of a loss function computed on held-out validation data to assess a model’s predictions.
Deep Learning with R, Third Edition
Validation loss is the loss value computed from a model's predictions on validation data.
- How it is used
- Monitors whether model learning remains useful on unseen validation data and helps detect overfitting during training.
- How deep it goes
- Defines the metric, explains strict data separation, demonstrates fit() and evaluate(), and stops short of detailed generalization theory.
- Examples
- Demonstrates a 30% R/Keras validation split, evaluate(), image datasets, loss curves, and val_loss-based checkpointing.
- What you can do after
- Operate/configure Keras training to monitor validation loss, evaluate held-out data, and retain the best-performing epoch.
Read how Deep Learning with R, Third Edition explains validation loss →
Deep Learning with PyTorch, Second Edition
Loss computed on held-out validation data.
- How it is used
- Uses held-out data to check whether training improvements generalize beyond observed samples.
- 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.
Read how Deep Learning with PyTorch, Second Edition explains validation loss →
Deep Learning with Python, Third Edition
The loss value computed on validation data to estimate how well a model generalizes beyond the training set.
- How it is used
- Monitors whether training improves performance on unseen data and supports selecting a model before overfitting.
- How deep it goes
- Explains held-out computation, Keras evaluation, curve interpretation, and checkpoint selection, but defers deeper generalization theory.
- Examples
- Uses shuffled NumPy splits, Keras evaluate(), image datasets, loss curves, and a ConvNet checkpoint monitored by val_loss.
- What you can do after
- Diagnose overfitting, compute held-out loss with Keras, and save or reload the epoch with the lowest validation loss.
Read how Deep Learning with Python, Third Edition explains validation loss →
LLMs in Production
Validation loss is the loss computed on held-out validation examples to assess a model during development.
- How it is used
- Uses averaged validation batches to monitor model behavior during training and development.
- How deep it goes
- Defines the metric and implements ten-batch averaging, but stops short of treating it as a representative performance measure.
- Examples
- Uses TinyStories training and validation files plus a PyTorch function that averages ten sampled validation-batch losses.
- What you can do after
- Evaluate model behavior during development with a repeatable validation-batch loss estimate.
Generative AI in Action
Validation loss is a metric measuring a model’s prediction error on examples held out for validation.
- How it is used
- Tracks how well fine-tuning generalizes beyond training examples during model adaptation.
- How deep it goes
- Defines the metric, its cost-function calculation, epoch timing, and relationship to overfitting without mathematical derivation.
- Examples
- Uses a GPT-3.5 Turbo fine-tuning loss graph showing loss values across training steps.
- What you can do after
- Evaluate fine-tuning progress and identify potential overfitting by comparing training and validation loss.
Related concepts
- generalizationmeasures · Generalization is the extension of a pattern, model, solution, or conclusion beyond the specific examples or cases from which it was derived.
- overfittingmeasures · Overfitting is a modeling condition in which a model fits patterns or idiosyncrasies in its training data too closely and consequently generalizes poorly to new data.
- objective functioncontrasts with · An objective function is a function or criterion that assigns values to candidate solutions or parameter settings and is optimized by minimizing or maximizing those values.
- evaluation datasetmeasures · An evaluation dataset is a collection of examples or test cases, often with expected or judged outcomes, designated to assess a model or system against defined criteria.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




