10 / 15 · 90–120 min
From noise to samples.
How do denoising steps produce two modes?
Check my intuition
01 · Predict
Before changing the settings.
We noise x₀ = 2 using α = 0.25 and ε = 0. With xₜ = √α x₀ + √(1−α) ε, what value results?
A hint
The square root of 0.25 is 0.5.
02 · Experiment and compare
Put the model to the test.
Move progress from 0 to 100%. Compare 5 and 80 steps, then condition on the upper mode. Keep the seed fixed to follow the same samples and observe discretization effects.
48 samples. Analytical denoiser for a two-Gaussian mixture, without training or an image model. The dashed trace follows one sample; it is not a robot trajectory.
- Denoising
- 100.00 %
- Distance to modes
- 0.20
- Upper samples
- 37.50 %
Read values as a table
| Sample | x | y |
|---|---|---|
| 1.00 | 2.84 | -1.86 |
| 2.00 | 2.70 | -2.10 |
| 3.00 | 2.91 | 2.12 |
| 4.00 | 2.96 | -2.23 |
| 5.00 | 2.89 | -2.50 |
| 6.00 | 3.09 | 2.07 |
| 7.00 | 3.25 | 1.90 |
| 8.00 | 3.18 | 2.08 |
| 9.00 | 3.07 | -2.16 |
| 10.00 | 3.40 | -2.04 |
| 11.00 | 2.83 | -1.97 |
| 12.00 | 3.08 | 1.88 |
| 13.00 | 2.93 | -2.12 |
| 14.00 | 2.95 | 1.88 |
| 15.00 | 2.95 | 1.83 |
| 16.00 | 3.34 | -2.16 |
| 17.00 | 3.13 | -1.92 |
| 18.00 | 2.99 | 1.89 |
| 19.00 | 3.08 | 2.28 |
| 20.00 | 3.15 | -2.10 |
| 21.00 | 2.80 | -1.82 |
| 22.00 | 2.76 | -1.82 |
| 23.00 | 3.01 | -2.12 |
| 24.00 | 3.21 | -1.88 |
| 25.00 | 3.09 | -2.30 |
| 26.00 | 3.07 | 1.75 |
| 27.00 | 2.96 | -2.17 |
| 28.00 | 2.82 | 1.90 |
| 29.00 | 3.12 | 1.90 |
| 30.00 | 3.15 | -1.90 |
| 31.00 | 2.96 | 1.99 |
| 32.00 | 3.02 | -2.07 |
| 33.00 | 3.29 | -1.83 |
| 34.00 | 2.96 | 2.17 |
| 35.00 | 3.29 | 2.08 |
| 36.00 | 3.15 | -1.86 |
| 37.00 | 2.79 | -1.94 |
| 38.00 | 2.88 | -1.83 |
| 39.00 | 2.85 | -2.05 |
| 40.00 | 2.87 | -1.99 |
| 41.00 | 3.03 | -1.98 |
| 42.00 | 3.18 | 2.17 |
| 43.00 | 3.05 | -2.04 |
| 44.00 | 3.12 | -1.97 |
| 45.00 | 3.21 | 1.97 |
| 46.00 | 2.93 | -2.16 |
| 47.00 | 3.03 | -2.14 |
| 48.00 | 2.97 | 1.87 |
Understand the calculations
03 · Connect the diagram to calculations
The numbers behind motion.
Data is a known mixture of two Gaussians centred at (3, 2) and (3, −2), with equal variance σ₀². The denoiser computes E[x₀ | xₜ] exactly through Bayes. We use it in a deterministic DDIM-style sampler with α(t) = cos²(πt/2). Sampling starts from Gaussian noise. Too few steps can distort final spread. This laboratory contains no trained network, images or action trajectories.
xₜ = √αₜ x₀ + √(1−αₜ) ε
x̂₀ = E[x₀ | xₜ]
ε̂ = (xₜ − √αₜ x̂₀) / √(1−αₜ)
x_next = √α_next x̂₀ + √(1−α_next) ε̂A few lines to reconstruct
predicted_noise = (x - sqrt(alpha) * denoised) / sqrt(1-alpha)
x = sqrt(next_alpha) * denoised + sqrt(1-next_alpha) * predicted_noiseThe notebook provides one function per laboratory, hand-calculated examples and tests. Exercises isolate components; these pages run the complete simulations.
Keep an observation
04 · Record
What changed?
Compare two settings. Record the effect, your explanation and a case where the model might fail. Saving keeps the current settings and seed, not a certification of competence.
atomsh / lab