diffusion_models.gaussian_diffusion.gaussian_diffuser
Module Contents
- class GaussianDiffuser(beta_scheduler)[source]
Initializes the class instance.
- Parameters:
beta_scheduler (BaseBetaScheduler) – The beta scheduler instance to be used.
- classmethod from_checkpoint(checkpoint)[source]
Instantiate a Gaussian Diffuser from a training checkpoint.
- Parameters:
checkpoint (Checkpoint) – The training checkpoint object containing the trained model’s parameters and configuration.
- Returns:
An instance of the GaussianDiffuser class initialized with the parameters loaded from the given checkpoint.
- Return type:
- to(device='cpu')[source]
Moves the data to the specified device.
This performs a similar behaviour to the to method of PyTorch. moving the GaussianDiffuser and the BetaScheduler to the specified device.
- Parameters:
device (str) – The device to which the method should move the object. Default is “cpu”.
Example
>>> gaussian_diffuser = GaussianDiffuser() >>> gaussian_diffuser = gaussian_diffuser.to(device="cuda")
- diffuse_batch(images)[source]
Diffuse a batch of images.
Diffuse the given batch of images by adding noise based on the beta scheduler.