An epoch is one complete pass through the entire training dataset. Training usually repeats batches within each epoch: the model predicts, calculates loss, backpropagates gradients, and updates its weights. The number of epochs is a hyperparameter that affects model performance. section 2.2.1 section 2.4.1
Epochs organize training and help determine when to stop:
- A training epoch processes all batches from the training set once; each batch contributes predictions, loss, gradients, and parameter updates. section 2.4.2
- A validation set helps choose the number of epochs without relying only on training performance, reducing the risk of overfitting. section 2.2.1 section 2.4.1
- Early stopping can end training after validation loss fails to improve for a chosen patience period. section 2.4.1
From a training limit to an actual stopping point
A multicategory clothing classifier is configured to train for at most 100 epochs. Each epoch runs train_epoch(), evaluates average validation loss with val_epoch(), and checks EarlyStop(). Because validation loss stops improving, training ends after 19 epochs rather than reaching the maximum. A binary classifier instead runs for 50 epochs in a simpler example. section 2.4.2 section 2.3.2









