The number of epochs is a hyperparameter that defines the number of times that the learning algorithm will work through the entire training dataset. We use all of the data exactly once per epoch.

In one epoch, the entire training dataset is passed forward and backward via the neural network.
"In the example discussed in 'Iterations':"
  • The total training set of images = 5000
  • Batch Size = 64
  • Iterations = 78 ∵(5000/64 ≈78)

Hence, once you do 78 iterations, it means you are done with one epoch and the network has seen the entire training data once.

If we choose to have X epochs, the network will be seeing the entire data X times, during which weights are updated. Hopefully, after X epochs, or even before that, it should find the minimum.

source: researchgate

As the full dataset is passed multiple times to the same neural network (increasing epochs), the loss decreases. Still, as the number of epochs increases, the weights are changed more and more in the neural network, which thus may lead to overfitting.

Last updated on Nov 30, 2022

Get AI confident. Start using Hasty today.

Automate 90% of the work, reduce your time to deployment by 40%, and replace your whole ML software stack with our platform.

Start for free Check out our services