All You Need to Know about Batch Size, Epochs and Training Steps in a Neural Network

And the connection between them explained in plain English with examples

Rukshan Pramoditha
Data Science 365

--

Photo by Peter F on Unsplash

There might be multiple times you’ve searched Google for batch size, epochs and iterations.

If you’re a beginner in the deep learning field, you will easily get confused with these technical terms. This is because you still do not know the connection between them.

In the context of deep learning, batch size, epochs and training steps are called model hyperparameters that we need to configure manually. In addition to that, these are common hyperparameters that almost every neural network model has.

It is very important to know the exact meanings of these hyperparameters because we need to configure their values manually during the training process in the fit() method as follows.

In the above code block,

  • The batch_size refers to batch size.
  • The epochs refers to the number of epochs.
  • The steps_per_epoch refers to training steps in one epoch.

In addition, shuffle is also a hyperparameter (more on this shortly).

--

--

Rukshan Pramoditha
Data Science 365

3,000,000+ Views | BSc in Stats | Top 50 Data Science, AI/ML Technical Writer on Medium | Data Science Masterclass: https://datasciencemasterclass.substack.com