Epoch
An epoch is one complete pass through the training dataset. Think of training as practicing from a deck of examples: an epoch means the model has been shown every card once, usually in a freshly shuffled order. It is a measure of data exposure, not a single learning update.
How an epoch is builtDatasets are too large, and neural networks too expensive, to process all examples at once. Training divides the data into mini-batches. For each batch, the network makes predictions, computes loss, backpropagates gradients, and the optimizer—such as Adam—updates the parameters. If 50,000 examples are trained with batches of 100, one epoch contains 500 training steps (parameter updates).
- Batch: a small group of examples processed together.
- Step / iteration: one optimizer update from one batch.
- Epoch: enough steps to cover the full training set once.
One epoch rarely gives a model enough opportunity to fit useful patterns. Many epochs allow repeated refinement, but eventually the model can begin memorizing quirks of the training data rather than learning patterns that generalize. Training code therefore commonly records both training loss and validation loss after each epoch. Falling training loss alongside rising validation loss is a classic sign of overfitting. Early stopping can halt training when validation performance has stopped improving.
Epochs in a real training runEpoch boundaries are convenient points for practical controls: reshuffling data, saving checkpoints, evaluating on validation data, and changing the learning rate. A learning-rate schedule might reduce the rate after several stalled validation epochs, allowing a run that has plateaued to refine its solution. More epochs cost proportionally more compute and wall-clock time; they do not guarantee improvement. In frameworks such as Keras, epochs=20 requests twenty full passes, while the actual number completed can be smaller when early stopping intervenes.
An epoch is one complete pass through the entire training dataset. When data is processed in mini-batches, an epoch contains multiple forward passes, loss computations, gradient calculations, and parameter updates—one per batch. The number of epochs controls total training exposure: too few leaves the model undertrained, while too many can overfit unless validation metrics or regularisation constrain training.
Imagine a student practicing with a full stack of flashcards. One complete trip through every card is like an epoch in AI training.
An epoch means the learning system has looked at every example in its training collection once—perhaps every labeled photo of cats and dogs, or every sample sentence in a language dataset. After each pass, it has had a chance to improve a little.
One pass is rarely enough, just as reading flashcards once rarely makes you fluent. Training usually uses many epochs so the network can spot patterns more reliably. But too many can make it memorize the practice examples rather than handle new ones well.