diffusion_models.models.base_diffusion_model
Module Contents
- class BaseDiffusionModel(diffuser)[source]
Initializes the object with the specified diffuser.
BaseDiffusionModel is an abstract base class for different diffusion models implementations. It defines the interface that all diffusion models should adhere to.
- Parameters:
diffuser (BaseDiffuser) – The diffuser to use for the diffusion model.
Warning
Do not instantiate this class directly. Instead, build your own diffusion model by inheriting from BaseDiffusionModel. (see
SimpleUnet
)- diffuser: BaseDiffuser[source]
A diffuser to be used by the diffusion model.
- abstract forward(x, timestep)[source]
Forward pass of the diffusion model.
The forward pass of the diffusion model, predicting the noise at a single step.
- to(device='cpu')[source]
Moves the model to the specified device.
This performs a similar behaviour to the to method of PyTorch. moving the DiffusionModel and all related artifacts to the specified device.
- Parameters:
device (str) – The device to which the method should move the object. Default is “cpu”.