|
pulsatrix 1.1.0
|
The baseline rule as one call (roadmap XAI-6): run any explainer, probe or featurizer on the trained model and on a re-initialized ("null") model, and compare. More...
#include <cstdint>#include <string>#include <type_traits>#include <utility>#include <vector>#include "pulsatrix/explanation_metrics.hpp"#include "pulsatrix/module.hpp"
Go to the source code of this file.
Classes | |
| class | pulsatrix::ParameterSnapshot |
| Saves every parameter of a module and restores them exactly when it goes out of scope. More... | |
| struct | pulsatrix::NullModelComparison< Result > |
| NullModelBaseline()'s result: the analysis on the trained model and on the null model. More... | |
| struct | pulsatrix::AttributionNullReport |
| NullModelBaseline() for an explanation of one input. More... | |
Namespaces | |
| namespace | pulsatrix |
Functions | |
| void | pulsatrix::ReinitializeParameters (Module &model, uint64_t seed, const std::string &prefix="") |
Replaces each parameter tensor with Gaussian noise of mean 0 and that tensor's own standard deviation, from a portable generator seeded by seed. | |
| template<typename Analysis > | |
| auto | pulsatrix::NullModelBaseline (Module &model, Analysis &&analysis, uint64_t seed) -> NullModelComparison< std::decay_t< std::invoke_result_t< Analysis & > > > |
Runs analysis() on model, then again after ReinitializeParameters(model, seed), then restores the model exactly (also if analysis throws). | |
| AttributionNullReport | pulsatrix::NullModelBaseline (Module &model, const ExplainFn &explain, const Tensor &input, uint64_t seed) |
Explains input with the trained and the null model and compares the two. | |
The baseline rule as one call (roadmap XAI-6): run any explainer, probe or featurizer on the trained model and on a re-initialized ("null") model, and compare.