

def add_activations_summary(activation_ops, name_prefix='', name_suffix='', collection_key=None):
    ' add_activations_summary.\n\n    Add histogram summary for given activations.\n\n    Arguments:\n        activation_ops: A list of `Tensor`. The activations to summarize.\n        name_prefix: `str`. A prefix to add to summary scope.\n        name_suffix: `str`. A suffix to add to summary scope.\n        collection_key: `str`. A collection to store the summaries.\n\n    Returns:\n        The list of created activation summaries.\n    '
    summ = []
    for ao in activation_ops:
        ao_name = ao.op.name
        summ_name = format_scope_name(ao_name, name_prefix, ('Activations/' + name_suffix))
        summ_exists = summary_exists(summ_name)
        if (summ_exists is not None):
            tf.add_to_collection(collection_key, summ_exists)
        else:
            get_summary('histogram', summ_name, ao, collection_key)
        summ_name = format_scope_name(ao_name, name_prefix, ('Sparsity/' + name_suffix))
        summ_exists = summary_exists(summ_name)
        if (summ_exists is not None):
            tf.add_to_collection(collection_key, summ_exists)
            summ.append(summ_exists)
        else:
            summ.append(get_summary('scalar', summ_name, tf.nn.zero_fraction(ao), collection_key))
    return summ

dataset/ETHPy150Open tflearn/tflearn/tflearn/summaries.py add_activations_summary/original