pulsatrix
Loading...
Searching...
No Matches

LRP – whole-model Layer-wise Relevance Propagation explainer. More...

#include <cstdint>
#include <functional>
#include <memory>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
#include "pulsatrix/attribution.hpp"
#include "pulsatrix/conv2d_module.hpp"
#include "pulsatrix/device_backend.hpp"
#include "pulsatrix/explainer_context.hpp"
#include "pulsatrix/linear_module.hpp"
#include "pulsatrix/lrp_rule_config.hpp"
#include "pulsatrix/tensor.hpp"
Include dependency graph for lrp.hpp:

Go to the source code of this file.

Classes

struct  pulsatrix::LRPTarget
 What LRP explains: one target class (and optionally one contrast class) per row of the network's (N, num_classes) output. More...
 
class  pulsatrix::LRP
 Whole-model LRP: runs the forward pass, seeds relevance at the chosen output(s), and propagates it to the input through every module's own propagate_relevance() rule. More...
 

Namespaces

namespace  pulsatrix
 
namespace  pulsatrix::lrp_composite
 Zennit 1.0.0's composite presets (zennit.composites), mapped onto pulsatrix modules by type: LinearModule = torch Linear, Conv2DModule = torch Conv2d; every other module gets the epsilon rule (the pass-through modules – ReLU, Flatten, Dropout, MaxPool – ignore it, as Zennit's Pass rule / plain gradient does).
 
namespace  pulsatrix::lrp_composite::detail
 

Typedefs

using pulsatrix::LRPComposite = std::function< LRPRuleConfig(size_t layer_index, const Module &module)>
 Per-layer LRP rule choice: maps (top-level module index in forward order, module) to the LRPRuleConfig that module applies.
 

Enumerations

enum class  pulsatrix::LRPSeed { pulsatrix::OutputValue , pulsatrix::OneHot }
 How LRP seeds relevance at the target output. More...
 

Functions

bool pulsatrix::lrp_composite::detail::is_conv (const Module &module)
 
LRPRuleConfig pulsatrix::lrp_composite::detail::zennit_epsilon (float epsilon)
 
LRPRuleConfig pulsatrix::lrp_composite::detail::alpha_beta (float alpha, float beta, float epsilon)
 
LRPComposite pulsatrix::lrp_composite::epsilon_plus (float epsilon=1e-6f)
 Zennit EpsilonPlus: Epsilon for Linear, ZPlus (AlphaBeta 1, 0) for Conv2D.
 
LRPComposite pulsatrix::lrp_composite::epsilon_alpha2_beta1 (float epsilon=1e-6f)
 Zennit EpsilonAlpha2Beta1: Epsilon for Linear, AlphaBeta(2, 1) for Conv2D.
 
LRPComposite pulsatrix::lrp_composite::epsilon_gamma_box (float low, float high, float gamma=0.25f, float epsilon=1e-6f)
 Zennit EpsilonGammaBox: ZBox(low, high) for the first Conv2D layer (lowest index), Gamma(gamma) for every other Conv2D, Epsilon for every Linear.
 

Detailed Description

LRP – whole-model Layer-wise Relevance Propagation explainer.