peal.generators.ddpm_generator

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

This module wraps the guided-diffusion UNet vendored under peal.dependencies.ace as a PEAL EditCapableGenerator and InvertibleGenerator: it builds model and diffusion from a DDPMConfig, trains it with the guided-diffusion TrainLoop, and offers (DDIM or noising) encode, decode, repaint and sampling in pixel space. DDPM.edit produces counterfactuals by handing the model, the diffusion and the (optionally distilled) classifier to the vendored ACE or FastDiME main functions, sweeping their attack hyper-parameters over several attempts.

Functions

load_state_dict

Load a PyTorch file without redundant fetches across MPI ranks.

Classes

DDPM

Pixel-space denoising diffusion model used as a PEAL generator.

DDPMConfig

TODO actually implement this class properly This class defines the config of a DDPM.