|
pulsatrix 1.1.0
|
The contrastive explanation method (CEM; Dhurandhar et al., "Explanations based on the Missing", NeurIPS 2018): pertinent negatives, what is absent from an input and would change its class if present, and pertinent positives, the least of the input that keeps its class on its own (XAI-4). More...
#include <cstdint>#include <string>#include <vector>#include "pulsatrix/explainer_context.hpp"#include "pulsatrix/json.hpp"#include "pulsatrix/tensor.hpp"
Go to the source code of this file.
Classes | |
| struct | pulsatrix::ContrastiveOptions |
| CEM's settings. The defaults are the paper's MNIST settings, scaled to its 1,000 steps. More... | |
| struct | pulsatrix::ContrastiveResult |
| A pertinent negative or positive. More... | |
Namespaces | |
| namespace | pulsatrix |
Functions | |
| ContrastiveResult | pulsatrix::FindPertinentNegative (ExplainerContext &ctx, const Tensor &input, const ContrastiveOptions &options={}) |
The pertinent negative of input: what would have to be added, where the input has nothing, to change its class. | |
| ContrastiveResult | pulsatrix::FindPertinentPositive (ExplainerContext &ctx, const Tensor &input, const ContrastiveOptions &options={}) |
The pertinent positive of input: the least of it that the model still gives its class. | |
| JsonValue | pulsatrix::ToJson (const ContrastiveResult &result, const std::string &kind) |
The result as a pulsatrix.contrastive.v1 document; kind is "pertinent_negative" or "pertinent_positive". | |
The contrastive explanation method (CEM; Dhurandhar et al., "Explanations based on the Missing", NeurIPS 2018): pertinent negatives, what is absent from an input and would change its class if present, and pertinent positives, the least of the input that keeps its class on its own (XAI-4).
Both are found by FISTA on an elastic-net objective, with a binary search over the weight of the prediction loss, as in the paper. With x the input, t0 its class, z the model's outputs and b the absence value of each feature (the baseline, 0 by default):
The paper also adds an autoencoder's reconstruction error to keep δ on the data manifold; that term isn't here, so on images a pertinent negative can look like noise to a person.