diffusion_models.utils.schemas
Module Contents
- class TrainingConfiguration[source]
A training configuration for simple experiment management.
- mixed_precision_training: bool = False[source]
Whether or not to use automatic mixed precision training.
- mixed_precision_dtype: str = 'bfloat16'[source]
bfloat16(no gradient scaling needed) orfloat16(uses aGradScaler).- Type:
The autocast dtype when mixed precision is on
- channels_last: bool = False[source]
Whether to use the
channels_lastmemory format for the model and its inputs. This speeds up mixed precision training on tensor cores but is very slow in fp32, so it should be combined withmixed_precision_training.
- ema_decay: float | None = None[source]
The decay of the exponential moving average of the weights. Disabled when None.
- ema_warmup_steps: int = 0[source]
When positive, ramps the EMA decay up as
(1 + n) / (warmup + n)(capped atema_decay).
- latest_checkpoint_rate: int | None = None[source]
The rate (in epochs) at which the rolling
latest.ptis overwritten. Disabled when None.
- num_workers: int = 4[source]
The number of dataloader worker processes.
0loads data in the main process.
- pin_memory: bool = True[source]
Whether the dataloader copies batches into pinned memory (only used with CUDA).
- persistent_workers: bool = True[source]
Whether dataloader workers are kept alive between epochs (needs
num_workers > 0).
- class EvaluationConfiguration[source]
Settings of the FID / KID evaluation that runs during training.
- fid_rate: int | None = None[source]
The rate (in epochs) at which FID/KID is computed and logged. Also computed after the last epoch. Disabled when None.
- class LogConfiguration[source]
An object to manage logging configuration.
- class Checkpoint[source]
A simplified checkpoint framework for easy saving and loading.
- beta_scheduler_config: BetaSchedulerConfiguration[source]
The beta scheduler configuration.
- ema_model_state_dict: Dict[str, Any] | None = None[source]
The state dict of the EMA (exponential moving average) weights, if tracked.
- ema_num_updates: int | None = None[source]
The number of EMA updates performed so far (needed to resume the EMA warmup).
- completed_epochs: int | None = None[source]
The number of fully completed epochs. Training resumes from here.
- prediction_type: str = 'epsilon'[source]
What the model predicts (
"epsilon"or"v"). Legacy checkpoints are epsilon.
- config_yaml: str | None = None[source]
The resolved configuration (YAML) of the run that produced this checkpoint.
- loss: float | None = None[source]
The final loss value recorded.
Note
This is a legacy parameter and will be removed in a future release.
- classmethod from_file(file_path, map_location=None)[source]
Load and instantiate a checkpoint from a file.
- Parameters:
- Returns:
A checkpoint instance.
- Return type: