One JSON value: null, a boolean, a number, a string, an array or an object.
Definition json.hpp:22
A small strict JSON value, parser and deterministic writer (RFC 8259).
Definition acquisition_functions.hpp:16
const std::vector< XaiQuestion > & AllXaiQuestions()
All nine questions, in the enum's order.
@ Relevance
By the channel's relevance for the target class, summed over positions.
XaiReason
Adadi and Berrada's four reasons to explain a model (IEEE Access, 2018).
Definition explainer_capabilities.hpp:47
@ Improve
Improve the model: find what to change in its data, features or training.
@ Justify
Justify a decision to someone it affects or who must sign it off.
@ Control
Control the model: find its flaws and failure modes before they do harm.
@ Discover
Discover something new about the domain from what the model learned.
const std::vector< XaiReason > & AllXaiReasons()
All four reasons, in the enum's order.
std::optional< XaiQuestion > ParseXaiQuestion(std::string_view text)
JsonValue ExplainerCatalogDocument()
The whole catalog: a pulsatrix.explainer_catalog.v1 document.
std::string_view ReasonText(XaiReason reason)
One sentence on the reason.
std::optional< XaiReason > ParseXaiReason(std::string_view text)
ExplanationScope
Whether an explainer explains one prediction or the model as a whole.
Definition explainer_capabilities.hpp:59
@ Global
The model, a layer or a dataset.
@ Local
One input at a time (a batch is explained row by row).
const ExplainerCapabilities & ExplainerCapabilitiesOf(std::string_view name)
The catalog entry named name.
InputKind
What the explainer's input has to be.
Definition explainer_capabilities.hpp:81
@ Representation
Representations: an (N, d) matrix of activations or embeddings.
@ Protein
Amino-acid sequences into a protein language model.
@ Symbolic
Facts and rules in the Datalog engine.
@ Image
Images: (N, C, H, W).
@ Tokens
Token ids into a language model.
@ Tabular
A flat feature vector, one value per named feature.
std::string_view QuestionText(XaiQuestion question)
The question as Liao et al. phrase it, for example "Why is this instance given this prediction...
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.
@ Weights
The weights alone, without running the model.
@ Activations
Activations at a layer, collected beforehand or through a hook.
@ Gradients
Gradients through a pulsatrix network (an ExplainerContext or a Module).
XaiQuestion
The nine question categories of Liao, Gruen and Miller's XAI question bank (CHI 2020).
Definition explainer_capabilities.hpp:24
@ HowToStillBeThis
What can change, or must stay, for the prediction to remain the same.
@ WhatIf
What happens to the prediction if the input changes in a given way.
@ Output
What the model's output is and means: its schema, labels and scope.
@ Why
Why this input gets this prediction.
@ HowGlobal
How the model works overall: its general logic, the features and concepts it uses.
@ Performance
How well the model does: accuracy, calibration, error by slice, uncertainty.
@ WhyNot
Why this input gets this prediction instead of another one.
@ HowToBeThat
What change to the input would give a different, chosen prediction.
std::vector< const ExplainerCapabilities * > ExplainersFor(XaiQuestion question)
The explainers that answer question: those that list it first, then the rest, each group in catalog o...
JsonValue ToJson(const AttackResult &result, const AttackOptions &options)
The result as a pulsatrix.attack.v1 document, without the adversarial inputs.
const std::vector< ExplainerCapabilities > & ExplainerCatalog()
Every explainer pulsatrix has, in a fixed order.
std::string_view to_string(XaiQuestion question)
One explainer's declaration: what it answers and what it needs.
Definition explainer_capabilities.hpp:99
std::vector< std::string > entry_points
The calls that run it: "IntegratedGradients::explain".
Definition explainer_capabilities.hpp:105
bool complete
The attributions add up to the output, minus a baseline's where there is one: LRP's conservation,...
Definition explainer_capabilities.hpp:120
std::string header
The header to include: "pulsatrix/integrated_gradients.hpp".
Definition explainer_capabilities.hpp:103
ExplanationScope scope
Definition explainer_capabilities.hpp:110
std::string name
A stable identifier, the class or function name: "IntegratedGradients".
Definition explainer_capabilities.hpp:101
std::vector< XaiQuestion > questions
The questions it answers, the main one first.
Definition explainer_capabilities.hpp:109
bool needs_labels
It scores the model against true labels (the Performance metrics, conformal calibration),...
Definition explainer_capabilities.hpp:125
bool answers(XaiQuestion question) const
Whether question is among questions.
InputKind input
Definition explainer_capabilities.hpp:112
std::string summary
One sentence on what it computes.
Definition explainer_capabilities.hpp:107
int64_t max_features
The most input features it can take, or 0 for no limit: KernelSHAP enumerates every coalition,...
Definition explainer_capabilities.hpp:128
bool attribution
It returns an Attribution with one value per input element, so the metrics in explanation_metrics....
Definition explainer_capabilities.hpp:115
bool needs_base_model
It compares a model with the one it was fine-tuned from, so it needs both.
Definition explainer_capabilities.hpp:122
ModelAccess access
Definition explainer_capabilities.hpp:111