18 std::vector<float>
low;
33 float num_std = 1.0f);
42 float upper_percentile = 0.95f);
54 [[nodiscard]]
float swing()
const;
56 [[nodiscard]]
float slope()
const;
77 const Tensor& input, int64_t target_index,
79 const std::vector<int64_t>& features = {});
96 int64_t target_index,
const std::vector<int64_t>& window,
97 const std::vector<int64_t>& strides,
float baseline = 0.0f);
First-class explanation result type – values, method, and metadata together.
N-dimensional tensor. Owns its data buffer exclusively; a DeviceBackend* is injected (not owned) – th...
Definition tensor.hpp:29
Definition acquisition_functions.hpp:16
SensitivityBounds ScaledDeltaBounds(const Tensor &input, const std::vector< Tensor > &background, float num_std=1.0f)
x -/+ num_std standard deviations of each feature over background, so every feature moves by a compar...
Attribution Occlusion(const std::function< Tensor(const Tensor &)> &predict, const Tensor &input, int64_t target_index, const std::vector< int64_t > &window, const std::vector< int64_t > &strides, float baseline=0.0f)
Occlusion (Zeiler and Fergus 2014) with Captum 0.9's semantics: a window slides over the input with t...
LocalSensitivityResult ComputeLocalSensitivity(const std::function< Tensor(const Tensor &)> &predict, const Tensor &input, int64_t target_index, const SensitivityBounds &bounds, const std::vector< int64_t > &features={})
Sets each feature in turn to its low and then its high bound, leaving the others at the input's value...
SensitivityBounds DeltaBounds(const Tensor &input, float delta)
x - delta and x + delta for every feature.
SensitivityBounds RangeBounds(const std::vector< Tensor > &background, float lower_percentile=0.05f, float upper_percentile=0.95f)
Each feature's lower and upper percentile over background (linear interpolation, as numpy....
An explanation result: the raw attribution values, the method that produced them, and any relevant me...
Definition attribution.hpp:23
How one feature's low and high value move the output, everything else held fixed.
Definition sensitivity.hpp:45
float output_low
The target output with the feature at low
Definition sensitivity.hpp:50
float swing() const
|output_high - output_low|: the bar length in a tornado chart.
float low
Definition sensitivity.hpp:48
int64_t feature_index
Definition sensitivity.hpp:46
float value
The input's own value.
Definition sensitivity.hpp:47
float output_high
... and at high
Definition sensitivity.hpp:51
float slope() const
(output_high - output_low) / (high - low): a finite-difference slope; 0 if high == low.
float high
Definition sensitivity.hpp:49
One-at-a-time sensitivity of one output around one input.
Definition sensitivity.hpp:60
int64_t target_index
Definition sensitivity.hpp:61
std::vector< FeatureSensitivity > features
Definition sensitivity.hpp:63
float output
The target output at the unchanged input.
Definition sensitivity.hpp:62
The low and high value to try for every feature of an input (flat order).
Definition sensitivity.hpp:17
std::vector< float > low
Definition sensitivity.hpp:18
std::vector< float > high
Definition sensitivity.hpp:19
N-dimensional tensor – owns a buffer via DeviceBackend*, RAII (Rule of Five).