Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

value of steps per epoch passed to keras fit generator function

What is the need for setting steps_per_epoch value when calling the function fit_generator() when ideally it should be number of total samples/ batch size?

like image 789
AKSHAYAA VAIDYANATHAN Avatar asked Dec 21 '17 15:12

AKSHAYAA VAIDYANATHAN


1 Answers

Without data augmentation, the number of samples is static as Daniel mentioned. Then, the number of samples for training is steps_per_epoch * batch size.

By using ImageDataGenerator in Keras, we make additional training data for data augmentation. Therefore, the number of samples for training can be set by yourself. If you want two times training data, just set steps_per_epoch as (original sample size *2)/batch_size.

like image 175
hoesang choi Avatar answered Nov 15 '22 21:11

hoesang choi