What is the difference between steps and epochs in TensorFlow?

前端 未结 6 1659
春和景丽
春和景丽 2020-11-28 18:16

In most of the models, there is a steps parameter indicating the number of steps to run over data. But yet I see in most practical usage, we also execute t

6条回答
  •  迷失自我
    2020-11-28 18:44

    An epoch usually means one iteration over all of the training data. For instance if you have 20,000 images and a batch size of 100 then the epoch should contain 20,000 / 100 = 200 steps. However I usually just set a fixed number of steps like 1000 per epoch even though I have a much larger data set. At the end of the epoch I check the average cost and if it improved I save a checkpoint. There is no difference between steps from one epoch to another. I just treat them as checkpoints.

    People often shuffle around the data set between epochs. I prefer to use the random.sample function to choose the data to process in my epochs. So say I want to do 1000 steps with a batch size of 32. I will just randomly pick 32,000 samples from the pool of training data.

提交回复
热议问题