Epoch

An epoch is one complete pass of the entire training dataset through a learning algorithm. Models are usually trained for many epochs so they can gradually improve.

Data & AI

In a single epoch, the model sees every training example once and updates its parameters along the way. Training typically repeats for dozens or hundreds of epochs until the loss stops improving.

Too few epochs and the model underfits (hasn't learned enough); too many and it can start overfitting (memorizing the training data). Within each epoch, the data is usually processed in smaller chunks called batches.

Examples

Python

for epoch in range(3):
    # one full pass over the data
    loss = train_one_epoch(model, data)
    print(f"epoch {epoch}: loss={loss:.3f}")

Output:

epoch 0: loss=0.842
epoch 1: loss=0.531
epoch 2: loss=0.404

Learn it in a lesson

See also

Back to the Dictionary