Choosing number of Steps per Epoch

前端 未结 3 552
天涯浪人
天涯浪人 2021-01-30 15:25

If I want to train a model with train_generator, is there a significant difference between choosing

  • 10 Epochs with 500 Steps each

and

  • 100
3条回答
  •  伪装坚强ぢ
    2021-01-30 15:29

    Steps per epoch does not connect to epochs.

    Naturally what you want if to 1 epoch your generator pass through all of your training data one time. To achieve this you should provide steps per epoch equal to number of batches like this:

    steps_per_epoch = int( np.ceil(x_train.shape[0] / batch_size) )
    

    as from above equation the largest the batch_size, the lower the steps_per_epoch.

    Next you will choose epoch based on chosen validation. (choose what you think best)

提交回复
热议问题