2
$\begingroup$

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().

$\endgroup$

1 Answer 1

2
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ what will happen if i entered steps_per_epoch=50,but number of samples/batch size=100. What will happen then????? $\endgroup$
    – Shiv
    Commented 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.