|
pulsatrix
|
IG_i(x) = (x_i - baseline_i) * (1/steps) * sum_{k=1}^{steps} d(F(baseline + (k/steps)(x - baseline)))/dx_i – a Riemann-sum approximation of the straight-line path integral from baseline to input. More...
#include <integrated_gradients.hpp>
Public Member Functions | |
| Attribution | explain (ExplainerContext &ctx, const Tensor &input, const Tensor &baseline, int64_t target_index, int64_t steps, DeviceBackend *backend) const |
| Computes the Integrated Gradients attribution for one output index. | |
IG_i(x) = (x_i - baseline_i) * (1/steps) * sum_{k=1}^{steps} d(F(baseline + (k/steps)(x - baseline)))/dx_i – a Riemann-sum approximation of the straight-line path integral from baseline to input.
|
inline |
Computes the Integrated Gradients attribution for one output index.
| ctx | Context to run each interpolation step's forward/backward pass through. |
| input | Input to explain. |
| baseline | Reference "uninformative" input. Must match input's shape. |
| target_index | Which output element to attribute (0-based, flat index). |
| steps | Number of Riemann-sum interpolation steps (50-300 typical; more steps tightens the completeness-axiom approximation error). |
| backend | Backend to allocate intermediate tensors through. |