Skip to content

Commit bf4c581

Browse files
committed
Ignore bias in WSquareRule
1 parent 8b33243 commit bf4c581

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lrp/rules.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,15 @@ LRP-``w²`` rule. Commonly used on the first layer when values are unbounded.
193193
# Definition
194194
Propagates relevance ``R^{k+1}`` at layer output to ``R^k`` at layer input according to
195195
```math
196-
R_j^k = \\sum_i\\frac{w_{ij}^2}{\\sum_l w_{il}^2+b_i^2} R_i^{k+1}
196+
R_j^k = \\sum_i\\frac{w_{ij}^2}{\\sum_l w_{il}^2} R_i^{k+1}
197197
```
198198
199199
# References
200200
- $REF_MONTAVON_DTD
201201
"""
202202
struct WSquareRule <: AbstractLRPRule end
203-
modify_param!(::WSquareRule, p) = p .^= 2
203+
modify_weight!(::WSquareRule, w) = w .^= 2
204+
modify_bias!(::WSquareRule, b) = fill!(b, 0)
204205
modify_input(::WSquareRule, input) = ones_like(input)
205206

206207
"""

0 commit comments

Comments
 (0)