Shashi Tunga
Shashi Tunga

Reputation: 516

How to determine steps_per_epoch while using Image augumentation as it increase the number of images

model.fit_generator(datagen.flow(X_train,y_train,batch_size=32),epochs=10,steps_per_epoch=5000,validation_data=(X_test,y_test))

My total data size is 5000 and batch size is 32 , Then how to determine value for steps_per_epoch

case 1:When not using ImageAugumentation

cas2 2:When using using ImageAugumentation(Coz number images will increase and how to include that in steps_per_epoch)

Upvotes: 3

Views: 1511

Answers (1)

blackHoleDetector
blackHoleDetector

Reputation: 3033

The steps_per_epoch will be the total number of samples in your training set (before augmentation) divided by the batch size. So--

steps_per_epoch = 5000 / 32 ~ 156

Using data augmentation will not affect this calculation. You can also get more info about working with this parameter, as well as the fit_generator(), in my video on Training a CNN with Keras. The steps_per_epoch coverage starts around 4:08.

Upvotes: 8

Related Questions