b605766feed453f15039bf5336806f86b0a8efd3,keract/keract.py,,get_activations,#,4

Before Change


    // layer_outputs = [func([model_inputs, 0.])[0] for func in funcs]
    layer_outputs = [func(list_inputs)[0] for func in funcs]
    for layer_activations in layer_outputs:
        activations.append(layer_activations)
        // if print_shape_only:
        //     print(layer_activations.shape)
        // else:
        //     print(layer_activations)

After Change


               layer.name == layer_name or layer_name is None]  // all layer outputs

    // we remove the placeholders (Inputs node in Keras). Not the most elegant though..
    outputs = [output for output in outputs if "input_" not in output.name]

    funcs = [K.function(inp + [K.learning_phase()], [out]) for out in outputs]  // evaluation functions

    if model_multi_inputs_cond:
        list_inputs = []
        list_inputs.extend(model_inputs)
        list_inputs.append(0.)
    else:
        list_inputs = [model_inputs, 0.]

    // Learning phase. 0 = Test mode (no dropout or batch normalization)
    // layer_outputs = [func([model_inputs, 0.])[0] for func in funcs]
    activations = [func(list_inputs)[0] for func in funcs]
    layer_names = [output.name for output in outputs]

    result = dict(zip(layer_names, activations))
    return result


def display_activations(activations):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: philipperemy/keras-activations
Commit Name: b605766feed453f15039bf5336806f86b0a8efd3
Time: 2018-10-05
Author: premy@cogent.co.jp
File Name: keract/keract.py
Class Name:
Method Name: get_activations


Project Name: jazzband/django-debug-toolbar
Commit Name: e403821323d529980407c05da77409c7e1c5c2a0
Time: 2008-09-08
Author: rob@cogit8.org
File Name: debug_toolbar/panels/headers.py
Class Name: HeaderDebugPanel
Method Name: content


Project Name: jazzband/django-debug-toolbar
Commit Name: 3013b5a6e4c682004207e944ebea172a39e52e8c
Time: 2012-12-11
Author: david@gasmark6.com
File Name: debug_toolbar/utils/__init__.py
Class Name:
Method Name: render_stacktrace