peal.adaptors.didae

DiDAE: Dictionary-based Interpretable Diffusion Autoencoder Explanations.

Implements a 9-step automated counterfactual workflow:
  1. Distill user classifier into reference encoder space (closed-form least squares)

  2. Sweep all SAE directions in latent space

  3. Filter latent-space non-flips

  4. Decode surviving counterfactuals

  5. Filter ambient-space non-flips

  6. Rank directions by success count

  7. Display top-K directions via ClusterTeacher

  8. User labels directions true/false

  9. CFKD fine-tuning on false directions

Classes

DiDAE

DiDAE adaptor: discover shortcut directions in a diffusion autoencoder's latent with a sparse dictionary, have a teacher judge them, and repair the student with CFKD.

DiDAEConfig

Config for the DiDAE (Dictionary-based Interpretable DAE) adaptor.

ProbeModel

Linear probe on the generator's z_sem posing as a binary classifier.