Thomas Piacentini
← Workshop

10 / 15 · 90–120 min

From noise to samples.

How do denoising steps produce two modes?

Choose a laboratory
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.

lowerupperStep 40 / 40
Dots: current samples. Circles: distribution centres. Dashed: history of one sample.

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 %
Compare A and B →

Read values as a table
Samplexy
1.002.84-1.86
2.002.70-2.10
3.002.912.12
4.002.96-2.23
5.002.89-2.50
6.003.092.07
7.003.251.90
8.003.182.08
9.003.07-2.16
10.003.40-2.04
11.002.83-1.97
12.003.081.88
13.002.93-2.12
14.002.951.88
15.002.951.83
16.003.34-2.16
17.003.13-1.92
18.002.991.89
19.003.082.28
20.003.15-2.10
21.002.80-1.82
22.002.76-1.82
23.003.01-2.12
24.003.21-1.88
25.003.09-2.30
26.003.071.75
27.002.96-2.17
28.002.821.90
29.003.121.90
30.003.15-1.90
31.002.961.99
32.003.02-2.07
33.003.29-1.83
34.002.962.17
35.003.292.08
36.003.15-1.86
37.002.79-1.94
38.002.88-1.83
39.002.85-2.05
40.002.87-1.99
41.003.03-1.98
42.003.182.17
43.003.05-2.04
44.003.12-1.97
45.003.211.97
46.002.93-2.16
47.003.03-2.14
48.002.971.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_noise

The 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.

Open my notebook →

atomsh / lab