Search code examples
tensorflowmachine-learningtraining-data

Tensorflow (steps, batch_size and periods)


I am a little confused while training a model in tensorflow. What are steps and batch_size and periods in the train_model function? The code for the train_model function is given in the link to Learn from google AI


Solution

  • The number of steps, as described in the method's comment, is the number of forward and backward passes on a batch. The size of this batch (batch_size) is the number of training samples used for this training pass. You are approximating the loss, and therefore the gradient of your whole dataset by just computing it over batch_size samples. This basic terminology is explained in many introductory courses to neural networks.

    The loop over the period variable here is just used to display some loss metrics once in a while.