Loading…
Glossary term
Removing noise from data, the core step repeated in diffusion models.
Denoising removes noise from data. In diffusion models, training adds noise to real images in small steps and teaches a network to predict and remove it. At generation time the process runs in reverse, starting from pure noise. Each step makes the image a little cleaner.
Adding noise (the forward process)
import torch
def add_noise(x, alpha_bar):
noise = torch.randn_like(x)
return alpha_bar ** 0.5 * x + (1 - alpha_bar) ** 0.5 * noiseLearning to denoise is what lets diffusion models turn random noise into detailed images.