peal.generators

Generative models that render the counterfactuals the explainers need.

Every generator implements interfaces.Generator; invertible ones (InvertibleGenerator) add encode / decode and edit-capable ones (EditCapableGenerator) an edit that moves an image across a predictor’s decision boundary. Implementations: the DiffAE-based diffusion_autoencoder and its RAE twin, pixel / latent DDPMs (ddpm_generator, ddpm_pathldm), Stable Diffusion 3, Flux and the Stable Diffusion autoencoder, PathLDM for histopathology and a tabular DDPM. generator_factory.get_generator builds one from a GeneratorConfig yaml; deeplift_resnet provides DeepLift-safe ResNets used for attribution-guided generation.

Submodules

ddpm_generator

Pixel-space DDPM generator and the ACE/FastDiME counterfactual edit path.

deeplift_resnet

ResNet variants with one nn.ReLU instance per activation site.

generator_factory

Resolve a generator specification into a live generator object.

interfaces

Abstract interfaces every PEAL generator implements.

rae_pipeline

Two-stage RAEv2 training pipeline behind the RAEDiffusionAutoencoder generator.

tabular_ddpm

Minimal DDPM for low-dimensional tabular data with guided counterfactuals.