(self, metrics, summ_writer, log_prefix)
Log metrics to summary writer and history.
Log metrics to summary writer and history.
Log metrics to summary writer and history .
def log_metrics(self, metrics, summ_writer, log_prefix):
    """Log metrics to summary writer and history."""
    history = self._history
    rjust_len = max([0] + [len(name) for name in metrics])
    for name, value in metrics.items():
      self.log_step('%s %s | % .8f' % (
          log_prefix.ljust(5), name.rjust(rjust_len), value))
      full_name = 'metrics/' + name
      if history:
        history.append(log_prefix, full_name, self.step, value)
      if summ_writer:
        summ_writer.scalar(full_name, value, self.step)
def log_metrics ( self , metrics , summ_writer , log_prefix ) : history = self . _history rjust_len = max ( [ 0 ] + [ len ( name ) for name in metrics ] ) for name , value in metrics . items ( ) : self . log_step ( '%s %s | % .8f' % ( log_prefix . ljust ( 5 ) , name . rjust ( rjust_len ) , value ) ) full_name = 'metrics/' + name if history : history . append ( log_prefix , full_name , self . step , value ) if summ_writer : summ_writer . scalar ( full_name , value , self . step )