def default_training_callback(fd,
                                  loss, elapsed_time):
      """Called after each training step is executed.

      Arguments:
        fd: feed dictionary used for the training step.
        loss: model's loss on the minibatch just used.
        elapsed_time: time that has elapsed since training started.

      Returns:
        string that is a status update.
      """
      # All batches have the same shape. Pick the first one.
      minibatch_size = list(fd.values())[0].shape[0]
      self.num_examples += minibatch_size
      self.num_batches += 1
      self.total_loss += loss
      return ('%d examples in %.2f sec batch loss %.4f avg loss %.4f' %
              (self.num_examples, elapsed_time, loss,
               self.total_loss / self.num_batches))
Called after each training step is executed.

      Arguments:
        fd: feed dictionary used for the training step.
        loss: model's loss on the minibatch just used.
        elapsed_time: time that has elapsed since training started.

      Returns:
        string that is a status update.
      
language/nql/nql/util.py