Lesson 2 of 6 · 2 min
The idea
Add noise to a picture in many small steps. Train a network to guess the noise. To generate, start from pure noise and remove the guessed noise step by step.
import numpy as np
T = 200
beta = np.linspace(1e-4, 0.02, T)
keep = np.cumprod(1 - beta)
for t in (0, 50, 100, 199):
print(f"step {t:3}: {keep[t] ** 0.5:.2f} picture + {(1 - keep[t]) ** 0.5:.2f} noise")
