peal.entrypoints.train_generator

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

Calls train_model() on the generator class that peal.generators.generator_factory.get_generator picks from the config’s generator_type, e.g. DiffusionAutoencoder in peal/generators/diffusion_autoencoder.py or DDPMGenerator in peal/generators/ddpm_generator.py.

Invocation:

python train_generator.py --config <generator.yaml> \
    [--continue_training true] [--is_loaded true] [--seed N] \
    [--wandb_project peal_sae_analysis]

--continue_training resumes from the checkpoints in the run directory (it also sets is_loaded); --seed overrides the config seed. A W&B run named <generator_type>_<dataset_class> is opened when the package and an API key are available; otherwise training proceeds without it.

Reads the generator config and the data config it references. Writes the run directory base_path with config.yaml, checkpoints and sample images in the layout of the respective generator class.

Functions

main

Load the generator config, set up W&B if possible and train.

str2bool

Parse a command-line boolean such as yes/no or 1/0.