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 over a dataset during training or evaluation. Epochs provide a fixed stopping point: rather than waiting for the loss to reach zero or for successive solutions to stabilize, training runs for a chosen number of epochs. section 1.4 section 2.4.2

An epoch can update model weights or measure performance without changing them:

  • A training epoch uses backpropagation and an optimizer step to update the weights. section 2.4.2
  • A testing epoch records performance but must not adjust the weights. section 2.4.2

A fixed training loop

In a simple PyTorch optimization loop, `for epoch in range(60)` repeats the loss calculation, backward pass, and optimizer step 60 times. For model training or evaluation, `run_epoch` processes data from a DataLoader and updates weights only in training mode. section 1.4 section 2.4.2

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

How deep it goes
Explains fixed-step optimization and a PyTorch epoch loop, including how training updates differ from testing; does not specify how to choose an epoch count.
Examples
Uses a 60-iteration optimizer loop and a DataLoader-based epoch that updates weights only in training mode.
What you can do after
Apply epochs via PyTorch to run fixed-duration optimization or evaluate a model without updating its weights.
How it connects
Connects epochs to stochastic gradient descent, loss, optimizers, training, and evaluation.

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.