liveBook · Manning

Epoch

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

One complete pass over a dataset during training or evaluation.

An epoch is one complete pass through the available data during training or evaluation. Training epochs update model parameters; testing epochs measure performance without changing weights. section 2.4.2

A practical epoch loop typically:

  • Processes batches from a DataLoader and computes model loss. section 2.4.2
  • In training mode, backpropagates the loss, updates parameters with an optimizer, and clears gradients. section 1.4 section 2.4.2
  • In evaluation mode, records losses, predictions, labels, and scores without optimization. section 2.4.2

Fixed-step optimization

A minimal training schedule might use `for epoch in range(60)`: clear gradients, compute the loss, call `backward()`, and run `optimizer.step()`. The epoch count is a deliberate stopping choice rather than a guarantee of zero loss. section 1.4

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

How deep it goes
Explains fixed-count optimization and separates training from evaluation, including batch processing, metrics, gradients, and optimizer calls.
Examples
Uses a 60-iteration PyTorch loop and a reusable run_epoch function that stores losses, predictions, labels, and scores.
What it assumes
Assumes familiarity with model parameters, loss, gradients, optimizers, DataLoaders, and PyTorch training modes.
What you can do after
Operate/configure PyTorch training schedules with explicit epoch counts and safely distinguish parameter updates from evaluation.
How it connects
Connects epochs with stochastic gradient descent, loss functions, optimizers, DataLoaders, training mode, and evaluation mode.

Also explained in

Compare how 10 books explain epoch →

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.