5d4fc8599a4f750537bc3139db8bb3064aab20d3,innvestigate/analyzer/gradient_based.py,GuidedBackprop,__init__,#GuidedBackprop#Any#,171

Before Change


    

    def __init__(self, model, **kwargs):
        self._model_checks = [
            // todo: Check for non-linear output in general.
            {
                "check": lambda layer: kchecks.contains_activation(
                    layer, activation="softmax"),
                "type": "warning",
                "message": ("Typically models are analyzed with respect to "
                            "pre-softmax output."),
            },
            {
                "check":
                lambda layer: not kchecks.only_relu_activation(layer),
                "type": "warning",
                "message": ("Guided Backprop is only well defined for "
                            "neural networks with "
                            "relu activations."),
            },
        ]

        def reverse_layer_instance(Xs, Ys, reversed_Ys, reverse_state):
            activation = keras.layers.Activation("relu")
            reversed_Ys = kutils.apply(activation, reversed_Ys)

After Change



    def __init__(self, model, **kwargs):

        self._add_model_softmax_check()
        self._add_model_check(
            lambda layer: not kchecks.only_relu_activation(layer),
            "Deconvnet is only specified with networks with ReLU activations.",
            check_type="exception",
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: albermax/innvestigate
Commit Name: 5d4fc8599a4f750537bc3139db8bb3064aab20d3
Time: 2018-09-24
Author: work.alber.maximilian@gmail.com
File Name: innvestigate/analyzer/gradient_based.py
Class Name: GuidedBackprop
Method Name: __init__


Project Name: albermax/innvestigate
Commit Name: 5d4fc8599a4f750537bc3139db8bb3064aab20d3
Time: 2018-09-24
Author: work.alber.maximilian@gmail.com
File Name: innvestigate/analyzer/gradient_based.py
Class Name: Gradient
Method Name: __init__


Project Name: albermax/innvestigate
Commit Name: 5d4fc8599a4f750537bc3139db8bb3064aab20d3
Time: 2018-09-24
Author: work.alber.maximilian@gmail.com
File Name: innvestigate/analyzer/gradient_based.py
Class Name: BaselineGradient
Method Name: __init__


Project Name: albermax/innvestigate
Commit Name: 5d4fc8599a4f750537bc3139db8bb3064aab20d3
Time: 2018-09-24
Author: work.alber.maximilian@gmail.com
File Name: innvestigate/analyzer/gradient_based.py
Class Name: Deconvnet
Method Name: __init__