peal.entrypoints

Command-line entry points of PEAL.

This package holds the modules behind PEAL’s commands: running the adaptors (run_cfkd, run_didae, run_adaptor), the explainers (run_explainer), the training and evaluation scripts (train_generator, train_predictor, train_distilled_predictor, evaluate_predictor), the sparse-dictionary analyses (run_sae_analysis, run_component_analysis), the dataset generator (generate_dataset) and the config check (preflight).

Each module keeps a main() that takes no arguments and parses sys.argv itself, so it can be exposed as a console_scripts entry point of an installed PEAL.

The files of the same name in the repository root are thin wrappers that import main from here. They are kept because the reproduction scripts, the notebooks and the README all invoke the tools as python <script>.py ....

Submodules

evaluate_predictor

Print the accuracy and group accuracies of a trained predictor.

generate_dataset

Generate a synthetic confounded dataset from a DataConfig YAML.

preflight

Check run configs before spending GPU time on them.

run_adaptor

Run any PEAL adaptor from its YAML config.

run_cfkd

Run Counterfactual Knowledge Distillation (CFKD) from a YAML config.

run_component_analysis

Visualise every component of a sparse dictionary fitted on a generator.

run_didae

DiDAE: Dictionary-based Interpretable Diffusion Autoencoder Explanations.

run_explainer

Explain a trained predictor with a stand-alone explainer run.

run_sae_analysis

Fit or load a sparse dictionary on a generator's latents and evaluate it.

train_distilled_predictor

Distil a trained predictor into a smoother surrogate for counterfactuals.

train_generator

Train a PEAL generator (DDPM, diffusion autoencoder, RAE, ...) from YAML.

train_predictor

Train a predictor (student or test model) from a PredictorConfig YAML.