model.fit_generator(datagen.flow(X_train,y_train,batch_size=32),epochs=10,steps_per_epoch=5000,validation_data=(X_test,y_test))
我的总数据大小为5000,批量大小为32,那么如何确定steps_per_epoch的值
案例1:不使用ImageAugumentation时
cas2 2:使用ImageAugumentation时(Coz数字图像会增加以及如何在steps_per_epoch中包含它)
steps_per_epoch
将是训练集中的样本总数(扩充前)除以批量大小。所以 -
steps_per_epoch = 5000 / 32 ~ 156
使用数据扩充不会影响此计算。您还可以在我的fit_generator()
视频中获得有关使用此参数以及Training a CNN with Keras的更多信息。 steps_per_epoch
报道在4:08左右开始。