peal.explainers.interfaces.ExplainerConfig¶
- class peal.explainers.interfaces.ExplainerConfig[source]¶
Bases:
BaseModelBase pydantic config of an explainer.
Concrete explainers subclass this and add their own fields; the attributes documented inline below are common to all of them.
Methods
Attributes
The category of the config.
Widen (>1) or tighten (<1) the empirical [c_min, c_max] clamp of the "dynamic" linesearch about its midpoint, the same knob DiDAE's sweep exposes as component_bounds_scale.
The directory where the explanations are stored.
The number of samples that counterfactuals are created for.
How to merge clusters of explanations?
The number of counterfactuals created for the same sample.
How many counterfactuals are created for the same factual in parallel.
The port the feedback for the explanations shall be given when using the webinterface.
The seed of all randomness to make results reproducible.
The temperature used for the softmax when creating counterfactuals.
How many intermediate results are cached an visualized.
The restriction to interesting counterfactual transitions.
Whether to cluster the explanations and return most salient ones.
Whether to sanity check the used generator before creating explanations.
The type of explanation that shall be used.
- explainer_type: str¶
The type of explanation that shall be used. This is necessary to know which pydantic class to use when loading from yaml.
- category: str = 'explainer'¶
The category of the config. Can not be changed for explainer. This is also necessary to identify which pydantic class to use when loading from yaml.
- explanations_dir: str = 'explanations'¶
The directory where the explanations are stored. This only is used if explainer is executed directly and not e.g. executed via CFKD.
- port: int = 8000¶
The port the feedback for the explanations shall be given when using the webinterface.
- tracking_level: int = 2¶
How many intermediate results are cached an visualized. Goes from 0 = None over 1 = caching only to 2 = essential visualizations to 3 = all.
- validate_generator: bool = False¶
Whether to sanity check the used generator before creating explanations.
- max_samples: int | None = None¶
The number of samples that counterfactuals are created for. If set to None there will be one counterfactual created for every sample in dataset.
- temperature: float = 3.0¶
The temperature used for the softmax when creating counterfactuals. Can be useful for calibration if confidence goes against 0 or 1 too fast.
- transition_restrictions: list | None = None¶
The restriction to interesting counterfactual transitions. Helpful in the case of datasets with a lot of classes and heavy modes like ImageNet.
- component_bounds_scale: float = 1.0¶
Widen (>1) or tighten (<1) the empirical [c_min, c_max] clamp of the “dynamic” linesearch about its midpoint, the same knob DiDAE’s sweep exposes as component_bounds_scale. A direction DiDAE only found at x3 is unreachable for CFKD at x1, so DiDAE step 9 forwards its own value here. 1.0 = bounds as written.