liveBook · Manning

Evaluation dataset

As explained in Inside Deep Learning: Math, Algorithms, Models

A held-out dataset split used to evaluate or tune a model without using it for parameter learning.

A validation set is held-out data used to measure model performance without updating model weights. It lets training track metrics such as accuracy and F1 separately from training results, while keeping the evaluation data outside parameter learning. section 2.4.1 section 2.4.4

Use validation data to:

  • Compare training and held-out performance after each epoch, using separate result names and metric histories. section 2.4.1
  • Evaluate a candidate architecture or hyperparameter setting, such as layer count, neurons per layer, or learning rate. section 5.4.2
  • Protect the final evaluation from repeated reuse by creating temporary training/validation splits from the original training data. section 5.4.2
  • Evaluate in model evaluation mode with torch.no_grad(), and choose a validation batch size for speed because it does not affect results. section 2.4.4 section 2.5

Tracking validation accuracy in PyTorch

Create a separate DataLoader for held-out examples and pass it to the training function as test_loader. After each training epoch, switch the model to evaluation mode, run the loader under torch.no_grad(), and append its accuracy and F1 values alongside the training metrics. Plot train Acc against validation Acc to inspect how performance changes over time. section 2.4.4

Figure 5.17 The four steps of defining an objective function that Optuna can use to optimize our neural network training. The two most important steps shown as code are getting the hyperparameters and computing the result!

The objective-function workflow shows where validation splitting and validation-score computation fit into Optuna hyperparameter optimization. section 5.4.2

How Inside Deep Learning: Math, Algorithms, Models covers it

How deep it goes
Explains metric tracking, evaluation-mode execution, batching, and repeated-use protection, but does not detail statistical split strategies.
Examples
Uses synthetic moons data, PyTorch DataLoaders, accuracy and F1 curves, and Optuna searches over network size and learning rate.
What it assumes
Uses training loops, model evaluation, DataLoaders, and classification metrics while demonstrating held-out validation from dataset construction onward.
What you can do after
Apply it via PyTorch to evaluate held-out data, compare metrics, and supply validation scores to Optuna.
How it connects
Connects training sets, test sets, model evaluation, metrics, overfitting, and hyperparameter optimization.

Also explained in

Compare how 27 books explain evaluation dataset →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Inside Deep Learning: Math, Algorithms, Models. The section links point to the parts of the book it draws on.