### ...

parent 0e211fd1
 ... ... @@ -137,30 +137,29 @@ only the evidence for the actual class.

R = [None]*L + [A[L]*(T[:,None]==numpy.arange(10))]

The LRP-0, LRP-$\epsilon$, and LRP-$\gamma$ rules described in the LRP overview paper (Section 10.2.1) for propagating relevance on the lower layers are special cases of the more general propagation rule

The LRP-0, LRP-ϵ, and LRP-γ rules described in the LRP overview paper (Section 10.2.1) for propagating relevance on the lower layers are special cases of the more general propagation rule

(cf. Section 10.2.2), where $\rho$ is a function that transform the weights, and $\epsilon$ is a small positive increment. We define below two helper functions that perform the weight transformation and the incrementation. In practice, we would like to apply different rules at different layers (cf. Section 10.3). Therefore, we also give the layer index "l" as argument to these functions.

(cf. Section 10.2.2), where ρ is a function that transform the weights, and ϵ is a small positive increment. We define below two helper functions that perform the weight transformation and the incrementation. In practice, we would like to apply different rules at different layers (cf. Section 10.3). Therefore, we also give the layer index "l" as argument to these functions.

def rho(w,l): return w + [None,0.1,0.0,0.0][l] * numpy.maximum(0,w) def incr(z,l): return z + [None,0.0,0.1,0.0][l] * (z**2).mean()**.5+1e-9

In particular, these functions and the layer they receive as a parameter let us reduce the general rule to LRP-0 for the top-layer, to LRP-$\epsilon$ with $\epsilon = 0.1\,\text{std}$ for the layer just below, and to LRP-$\gamma$ with $\gamma=0.1$ for the layer before. We now come to the practical implementation of this general rule. It can be decomposed as a sequence of four computations:

us reduce the general rule to LRP-0 for the top-layer, to LRP-ϵ with ϵ = 0.1std for the layer just below, and to LRP-γ with γ=0.1 for the layer before. We now come to the practical implementation of this general rule. It can be decomposed as a sequence of four computations:

In this rule, $l_i$ and $h_i$ are the lower and upper bounds of pixel values, i.e. "-1" and "+1", and $(\cdot)^+$ and $(\cdot)^-$ are shortcut notations for $\max(0,\cdot)$ and $\min(0,\cdot)$. The $z^\mathcal{B}$-rule can again be implemented with a four-step procedure similar to the one used in the layers above. Here, we need to create two copies of the weights, and also create arrays of pixel values set to $l_i$ and $h_i$ respectively:

In this rule, li and hi are the lower and upper bounds of pixel values, i.e. "-1" and "+1", and (·)+ and (·) are shortcut notations for max(0,·) and min(0,·). The zB-rule can again be implemented with a four-step procedure similar to the one used in the layers above. Here, we need to create two copies of the weights, and also create arrays of pixel values set to li and hi respectively:

w = W ... ... @@ -348,7 +348,7 @@ c_j = \big[\nabla~\big({\textstyle \sum_k}~z_k(\boldsymbol{a}) \cdot s_k\big)\big]_j ">

where $s_k$ is treated as constant.

where sk is treated as constant.

Pooling layers: It is suggested in Section 10.3.2 of the paper to treat max-pooling layers as average pooling layers in the backward pass. ... ... @@ -411,10 +411,9 @@ dimensional maps are shown for a selection of VGG-16 layers.

We observe that the explanation becomes increasingly resolved spatially. Note that, like for the MNIST example, we have stopped the propagation procedure one layer before the pixels because the rule we have used is not applicable to pixel layers. Like for the MNIST case, we need ot apply the pixel-specific -rule for this last layer. This rule can again be implemented in terms of forward passes and gradient computations.

layers. Like for the MNIST case, we need ot apply the pixel-specific zB-rule for this last layer. This rule can again be implemented in terms of forward passes and gradient computations.