

def add_loss_summaries(total_loss, loss, regul_losses_collection_key, name_prefix='', summaries_collection_key=None, exp_moving_avg=0.9, ema_num_updates=None):
    ' add_loss_summaries.\n\n    Add scalar summaries (raw and averages) for given losses.\n\n    Generates moving average for all losses and associated summaries for\n    visualizing the performance of the network.\n\n    Arguments:\n        total_loss: `Tensor`. The total loss (Regression loss +\n            regularization losses).\n        loss: `Tensor`. Regression loss.\n        name_prefix: `str`. A prefix to add to the summary name.\n        regul_losses_collection_key: `str`. A collection name to retrieve\n            regularization losses.\n        exp_moving_avg: `float`. Exponential moving average.\n        ema_num_updates: `int`. Step to be used with exp moving avg.\n\n    Returns:\n        loss_averages_op: op for generating moving averages of losses.\n    '
    loss_averages = tf.train.ExponentialMovingAverage(exp_moving_avg, ema_num_updates, name='moving_avg')
    other_losses = tf.get_collection(regul_losses_collection_key)
    if ((len(other_losses) > 0) and (total_loss is not None)):
        loss_averages_op = loss_averages.apply((([total_loss] + [loss]) + other_losses))
        summ_name = ('- Loss & var loss/' + name_prefix)
        get_summary('scalar', summ_name, loss_averages.average(total_loss), summaries_collection_key)
        get_summary('scalar', (summ_name + ' (raw)'), total_loss, summaries_collection_key)
    elif (total_loss is not None):
        loss_averages_op = loss_averages.apply(([loss] + other_losses))
    else:
        loss_averages_op = loss_averages.apply([loss])
    summ_name = ('- Loss/' + name_prefix)
    get_summary('scalar', summ_name, loss_averages.average(loss), summaries_collection_key)
    get_summary('scalar', (summ_name + ' (raw)'), loss, summaries_collection_key)
    for wdl in other_losses:
        summ_name = wdl.op.name
        get_summary('scalar', summ_name, loss_averages.average(ema_num_updates), summaries_collection_key)
        get_summary('scalar', (summ_name + ' (raw)'), wdl, summaries_collection_key)
    return loss_averages_op

dataset/ETHPy150Open tflearn/tflearn/tflearn/summaries.py add_loss_summaries/VarMisuse@246/703 `wdl`->`ema_num_updates`