Suppose i have 1000 dog images and my batch size is 10.
It will take 1000/10=100 steps to complete 1 epoch.
So doesn't it mean steps_per_epoch=100 ?
Then why do we have to specify it separately in keras while applying .fit().
1 Answer
$\begingroup$
$\endgroup$
2
As clearly mentioned in the documentation:
Steps_per_epoch is total number of steps (batches of samples) before declaring one epoch finished and starting the next epoch. The default None is equal to the number of samples in your dataset divided by the batch size, or 1 if that cannot be determined. It is a optional parameter and is useful when passing an infinitely repeating dataset.
-
$\begingroup$ what will happen if i entered steps_per_epoch=50,but number of samples/batch size=100. What will happen then????? $\endgroup$– ShivCommented Aug 11, 2020 at 18:04
-
$\begingroup$ This is done usually for large datasets it will decay the learning rate for each epoch. Refer this: github.com/keras-team/keras/issues/10164 $\endgroup$ Commented Aug 11, 2020 at 19:28