original_docstring: Add summaries for losses in a model.
  
    Generates moving average for all losses and associated summaries for
    visualizing the performance of the network.
  
    Args:
      total_loss: Total loss from loss().
    Returns:
      loss_averages_op: op for generating moving averages of losses.
    
docstring: Add summaries for losses in a model.
  Generates moving average for all losses and associated summaries for
  visualizing the performance of the network.
docstring_tokens: Add summaries for losses in a model . Generates moving average for all losses and associated summaries for visualizing the performance of the network .
code: def loss_summaries(total_loss):
    """Add summaries for losses in a model.
  
    Generates moving average for all losses and associated summaries for
    visualizing the performance of the network.
  
    Args:
      total_loss: Total loss from loss().
    Returns:
      loss_averages_op: op for generating moving averages of losses.
    """
    # Compute the moving average of all individual losses and the total loss.
    loss_averages = tf.train.ExponentialMovingAverage(0.9, name='avg')
    losses = tf.get_collection('losses')
    loss_averages_op = loss_averages.apply(losses + [total_loss])
  
    # Attach a scalar summary to all individual losses and the total loss; do the
    # same for the averaged version of the losses.
    for l in losses + [total_loss]:
      # Name each loss as '(raw)' and name the moving average version of the loss
      # as the original loss name.
      tf.summary.scalar(l.op.name + ' (raw)', l)
      tf.summary.scalar(l.op.name, loss_averages.average(l))
  
    return loss_averages_op
code_tokens: def loss_summaries ( total_loss ) : loss_averages = tf . train . ExponentialMovingAverage ( 0.9 , name = 'avg' ) losses = tf . get_collection ( 'losses' ) loss_averages_op = loss_averages . apply ( losses + [ total_loss ] ) for l in losses + [ total_loss ] : tf . summary . scalar ( l . op . name + ' (raw)' , l ) tf . summary . scalar ( l . op . name , loss_averages . average ( l ) ) return loss_averages_op
short_docstring: Add summaries for losses in a model.
short_docstring_tokens: Add summaries for losses in a model .
comment: """Add summaries for losses in a model.
  
    Generates moving average for all losses and associated summaries for
    visualizing the performance of the network.
  
    Args:
      total_loss: Total loss from loss().
    Returns:
      loss_averages_op: op for generating moving averages of losses.
    """$SEP$# Compute the moving average of all individual losses and the total loss.$SEP$# Attach a scalar summary to all individual losses and the total loss; do the$SEP$# same for the averaged version of the losses.$SEP$# Name each loss as '(raw)' and name the moving average version of the loss$SEP$# as the original loss name.