diffusion_models.models.SimpleUnet
Module Contents
- class Block(in_ch, out_ch, time_emb_dim, up=False)[source]
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- class SinusoidalPositionEmbeddings(dim)[source]
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- class SimpleUnet(diffuser, image_channels)[source]
A Simplified variant of the Unet architecture used in DDPM.
- Parameters:
diffuser (GaussianDiffuser) – A gaussian diffuser.
image_channels (int) – The number of image channels.
- forward(x, timestep)[source]
Forward pass of the diffusion model.
The forward pass of the diffusion model, predicting the noise at a single step.
- Parameters:
x – A batch of noisy images.
timestep – The timesteps of each image in the batch.
- Returns:
A tensor representing the noise predicted for each image.