In machine learning and deep learning, an epoch is the period during which a model learns from the entire training dataset exactly once. With each epoch, the model learns patterns from the training data and updates its parameters. The concept comes from optimization algorithms and the training process of deep learning: by using the full dataset many times to update the model's parameters, the aim is to avoid overfitting and underfitting. In general, the number of epochs is set in advance as a hyperparameter and is used to evaluate the model's accuracy as training progresses.
Glossary
Epoch
Updated:

Explanation
Use cases
Epochs are used in the training process in the following ways:
- Tracking training progress: the model's performance is evaluated regularly at each epoch, and accuracy and loss are recorded to understand how training is progressing.
- Adjusting the learning rate: by changing the learning rate dynamically according to the epoch count, an approach can be adopted that uses large step sizes in the early stages of training and fine-tunes in the later stages (e.g., learning rate decay).
- Early stopping: if the loss on the validation data stops improving as the epochs increase, training is stopped early to prevent overfitting.
- Saving the model: by saving the model's state regularly at each epoch, the model from the epoch with the best performance can be used later.
The epoch is an important element in training deep learning models. Because it strongly affects the effectiveness and accuracy of training, it is important to set it appropriately.
FAQ
- Q. Why are epochs needed?
- A.
By learning from the entire training dataset many times, the model learns more generalized patterns and improves its accuracy.
- Q. How is the number of epochs decided?
- A.
A predetermined number of epochs is often used, but early stopping may also be used while watching how the validation loss changes.
- Q. What happens during an epoch?
- A.
The whole dataset is split into mini-batches, which are fed to the model in turn; the loss is computed, and the parameters are updated through backpropagation.
