Purpose of steps per epoch

If you have a large dataset of say, 20_000 and the batch size is 20, you’ll have 1000 batches i.e. each epoch will consist of 1000 batches of data. If you want to limit the number of batches per epoch, use steps_per_epoch. When this is set to a value like 10, each epoch will now process only 10 batches of data.
One thing to note is that when you’re done with the 1st epoch by processing batches 1 through 10, the next epoch will start from the 11th batch in the underlying dataset.

If steps_per_epoch is not set, each epoch will process all the batches in the dataset.

1 Like