158 const std::vector<ExplainerCapabilities>* catalog_;
Plans explanations from the explainer catalog.
Definition explanation_planner.hpp:147
ExplanationPlan plan(XaiQuestion question, XaiReason reason, const ModelTraits &traits={}) const
The plan for question, asked for reason, about a model with traits.
ExplanationPlanner()
Plans from ExplainerCatalog().
ExplanationPlanner(const std::vector< ExplainerCapabilities > &catalog)
Plans from another catalog, which must outlive the planner and its plans.
One JSON value: null, a boolean, a number, a string, an array or an object.
Definition json.hpp:22
What each explainer answers: the nine question categories (Liao, Gruen and Miller,...
A small strict JSON value, parser and deterministic writer (RFC 8259).
Definition acquisition_functions.hpp:16
std::string DescribePlan(const ExplanationPlan &plan)
The plan as plain text, for a terminal or a log: the question, the explainers in order with their rea...
XaiReason
Adadi and Berrada's four reasons to explain a model (IEEE Access, 2018).
Definition explainer_capabilities.hpp:47
@ Justify
Justify a decision to someone it affects or who must sign it off.
CheckPriority
How much a check matters for this reason.
Definition explanation_planner.hpp:56
@ Recommended
Worth running; the reason doesn't depend on it.
@ Required
The reason requires it: an explanation without it shouldn't be used for that reason.
InputKind
What the explainer's input has to be.
Definition explainer_capabilities.hpp:81
ModelAccess
The least an explainer needs from the model, from least to most access.
Definition explainer_capabilities.hpp:67
@ BlackBox
Only a prediction function, Tensor(const Tensor&): works on any model.
XaiQuestion
The nine question categories of Liao, Gruen and Miller's XAI question bank (CHI 2020).
Definition explainer_capabilities.hpp:24
@ Why
Why this input gets this prediction.
JsonValue ToJson(const AttackResult &result, const AttackOptions &options)
The result as a pulsatrix.attack.v1 document, without the adversarial inputs.
std::string_view to_string(XaiQuestion question)
An explainer that answers the question but can't run on this model.
Definition explanation_planner.hpp:97
std::string reason
Why not: "needs gradients; the model gives a black box".
Definition explanation_planner.hpp:100
const ExplainerCapabilities * capabilities
Definition explanation_planner.hpp:98
One explainer's declaration: what it answers and what it needs.
Definition explainer_capabilities.hpp:99
What ExplanationPlanner::plan() returns.
Definition explanation_planner.hpp:104
bool complete() const
Whether every required check can run and some explainer applies.
std::vector< std::string > warnings
What the plan can't deliver: a question with no explainer, a required check that can't run....
Definition explanation_planner.hpp:116
XaiQuestion question
Definition explanation_planner.hpp:105
std::vector< ExcludedExplainer > excluded
The explainers that answer the question but need more than the caller has.
Definition explanation_planner.hpp:113
ModelTraits traits
Definition explanation_planner.hpp:107
std::vector< PlannedExplainer > explainers
The explainers to use, best first. Empty when none can answer the question here.
Definition explanation_planner.hpp:109
XaiReason reason
Definition explanation_planner.hpp:106
std::vector< PlannedCheck > checks
The checks to run on their results, required ones first.
Definition explanation_planner.hpp:111
What the caller has: the model, its inputs and its data.
Definition explanation_planner.hpp:32
int64_t features
How many features each input has, or 0 if unknown; explainers with a limit (ExplainerCapabilities::ma...
Definition explanation_planner.hpp:52
bool can_reinitialize
A pulsatrix Module whose weights can be redrawn and restored, for the randomization test and the null...
Definition explanation_planner.hpp:41
InputKind input
What the model takes. Any means unknown: explainers for one kind of input are then kept,...
Definition explanation_planner.hpp:38
bool has_base_model
The model this one was fine-tuned from, for explainers that compare the two.
Definition explanation_planner.hpp:49
bool has_labels
The dataset's true labels, and a slice for each input (a group, a data source), for the per-slice err...
Definition explanation_planner.hpp:47
bool has_dataset
Many inputs, not just the one being explained: global explainers need them, and so does aggregating e...
Definition explanation_planner.hpp:44
ModelAccess access
The most the model gives, from a prediction function only (BlackBox) to an LRP rule at every layer (R...
Definition explanation_planner.hpp:35
One check the plan asks for.
Definition explanation_planner.hpp:64
std::string name
A stable identifier: "faithfulness", "stability", "robustness", "conservation", "randomization",...
Definition explanation_planner.hpp:69
std::vector< std::string > entry_points
Definition explanation_planner.hpp:72
std::vector< std::string > applies_to
The explainers it applies to; empty for all of them.
Definition explanation_planner.hpp:77
std::string unavailable_reason
Why it can't, when it can't.
Definition explanation_planner.hpp:81
bool available
Whether it can run with what the caller has.
Definition explanation_planner.hpp:79
CheckPriority priority
Definition explanation_planner.hpp:75
std::string purpose
What it tests, in one sentence.
Definition explanation_planner.hpp:74
std::string header
The header and the calls that run it; empty when pulsatrix has none yet.
Definition explanation_planner.hpp:71
One explainer the plan recommends.
Definition explanation_planner.hpp:85
const ExplainerCapabilities * capabilities
Its catalog entry.
Definition explanation_planner.hpp:87
std::vector< std::string > reasons
Why it is ranked where it is, one phrase each: "answers why as its main question".
Definition explanation_planner.hpp:91
int rank
Its place in the ranking, from 1.
Definition explanation_planner.hpp:89
std::vector< std::string > conditions
What must hold for it to apply, when the traits don't say: "needs image input".
Definition explanation_planner.hpp:93