pulsatrix
Loading...
Searching...
No Matches
lrp_rule_config.hpp
Go to the documentation of this file.
1
8#pragma once
9
10#include <string>
11
12namespace pulsatrix {
13
19enum class LRPRule {
22 Epsilon,
26 Gamma,
31 ZBox
32};
33
35inline std::string lrp_rule_name(LRPRule rule) {
36 switch (rule) {
38 return "epsilon";
39 case LRPRule::Gamma:
40 return "gamma";
42 return "alpha_beta";
43 case LRPRule::ZBox:
44 return "zbox";
45 }
46 return "unknown";
47}
48
59 float epsilon = 1e-6f;
63 float gamma = 0.25f;
65 float alpha = 1.0f;
67 float beta = 0.0f;
69 float low = 0.0f;
71 float high = 1.0f;
78};
79
80} // namespace pulsatrix
Definition acquisition_functions.hpp:16
std::string lrp_rule_name(LRPRule rule)
Lower-case rule name ("epsilon", "gamma", "alpha_beta", "zbox") for messages/metadata.
Definition lrp_rule_config.hpp:35
LRPRule
The LRP rule family a module applies. Semantics follow Zennit 1.0.0 exactly (Anders et al....
Definition lrp_rule_config.hpp:19
@ AlphaBeta
Alpha-beta rule (Bach et al. 2015) with alpha - beta == 1; alpha 1, beta 0 is ZPlus.
Configuration for LRP relevance propagation: which rule a module applies and its hyperparameters....
Definition lrp_rule_config.hpp:57
float low
ZBox rule: lowest admissible input value (scalar, applied to every input element).
Definition lrp_rule_config.hpp:69
float epsilon
Stabilizer added to every rule's denominator: z + epsilon * sign(z), sign(0) = +1.
Definition lrp_rule_config.hpp:59
float gamma
Gamma rule: weight of the positive (or negative) part added to the weights.
Definition lrp_rule_config.hpp:63
float beta
AlphaBeta rule: weight of the negative contributions.
Definition lrp_rule_config.hpp:67
float high
ZBox rule: highest admissible input value.
Definition lrp_rule_config.hpp:71
float alpha
AlphaBeta rule: weight of the positive contributions. Needs alpha, beta >= 0, alpha - beta == 1.
Definition lrp_rule_config.hpp:65
bool epsilon_bias_in_denominator
Epsilon rule only, honoured by LinearModule / Conv2DModule: include the bias in the denominator,...
Definition lrp_rule_config.hpp:77
LRPRule rule
Which rule to apply.
Definition lrp_rule_config.hpp:61