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









