Forward noising: state the normalization before quoting an SNR
Derive variance-preserving Gaussian corruption, cumulative schedule coefficients, and the domain of signal-to-noise measurements.
On this page
The question for today
What you’ll understand
- Construct a noisy training sample from explicit signal and noise coefficients.
- Distinguish conditional noise variance from data-dependent marginal variance.
- Identify endpoint and normalization assumptions behind a coefficient SNR.
Diffusion training starts with a corruption process whose samples and targets are known. Small notation mistakes can change the task: a variance is not a standard deviation, one-step alpha is not cumulative alpha, and an SNR depends on how the data is scaled. Fix a forward convention before comparing schedules, losses, or model outputs.
A variance-preserving marginal gives a direct training sample
This module uses x_t=a_t x_0+σ_t ε with independent standard Gaussian noise and a_t²+σ_t²=1. The name variance-preserving refers to the coefficient construction; a data coordinate with unit variance then retains unit marginal variance. Conditional on a fixed clean sample, the variance is only σ_t². If the clean data has another variance or nonzero mean, its marginal moments change accordingly. Images or autoencoder latents therefore need a recorded normalization rather than an assumed unit-scale convention.
For discrete DDPM, each one-step variance beta defines alpha=1−beta, while the cumulative product of alphas determines the direct marginal coefficients. Sampling that marginal avoids simulating all previous forward steps for every training example. It is still a statement about a specific process and timestep index. A scheduler using another continuous-time SDE, a different signal scale, or another interpolation requires its own equations. Do not combine its sigmas with this module's target formulas without checking the conversion.
Coefficient SNR needs a data-scale qualification
Under independent zero-mean unit-variance clean coordinates and noise, signal variance is a_t² and added noise variance is σ_t². Their ratio is the commonly used coefficient SNR. For a coordinate with clean variance v, the actual signal-to-added-noise variance ratio is a_t²v/σ_t². Rescaling a latent representation therefore changes this ratio unless the schedule is adjusted. Record whether a reported SNR is the coefficient ratio, a measured data-scale quantity, or a log-SNR used as a network input.
At zero added noise, the ratio diverges and score targets involving division by sigma are undefined under their ordinary formulas. At zero signal, converting a predicted noise value into a clean sample by dividing by a is undefined. Practical schedules and endpoint handling must state which values are trained and which are only limiting cases. More diffusion timesteps do not automatically improve learning if their noise levels, sampling distribution, and weights are changed at the same time.
Test the corruption process before training a large network
Check a tiny batch against hand-computed coefficients, then estimate conditional means and variances over repeated noise draws. Verify tensor broadcasting, timestep indexing, dtype, normalization, and that the sampled noise used in the target is the intended one. A debug run should preserve its clean samples, noise, and timesteps so two implementations can compare identical inputs. A plot that looks noisier at later indices is not enough to establish the exact training distribution or target alignment.
The function lab isolates the square turning noise amplitude into variance. Reset, set a=1 and x=0.60 in y=ax², predict y=0.36, then Play or Step. Separately Reset, set a=1 and x=0.80, predict y=0.64, then Play or Step. Here the graph's x is an amplitude proxy, not diffusion time, and its coefficient is unrelated to the forward signal coefficient a_t. It contains no Gaussian sampler or image. Use the squared values with the separate VP equation to compute the matching signal coefficients.
Work it through
Construct one noisy coordinate
At one VP noise level, a=0.8 and sigma=0.6. Take the clean coordinate x_0=2 and the realized standard-noise draw epsilon=−1. For the SNR comparison only, assume the training population has unit clean variance.
The coefficient normalization holds: 0.8²+0.6²=0.64+0.36=1. The added conditional noise variance is 0.36.
The realized noisy coordinate is x_t=0.8×2+0.6×(−1)=1.0. This one realization is not a variance estimate.
Coefficient SNR is 0.64/0.36=16/9≈1.7778. If clean variance were four instead, the signal-variance ratio would be 4×16/9≈7.1111 under the same coefficients.
The noisy coordinate, conditional variance, and coefficient SNR are different quantities with explicit scale assumptions.
The living notebook
Explore the model
Interactive lab · function
Noise variance is amplitude squared
Reset, set a=1 and x=0.60, predict y=0.36, then Play or Step. Separately Reset, set a=1 and x=0.80, predict y=0.64, then Play or Step. The fixed quadratic has no Gaussian draws, diffusion schedule, image, or training loop; x is only a noise-amplitude proxy.
- y at chosen x
- 0.608
- Tangent slope · 2ax
- 1.35
- Signed area · ax³/3
- 0.182
This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forDo not substitute a standard deviation for its variance in a forward process or SNR.
Pause & reason
Check your understanding
Your turn
Try it yourself
Let a=0.6,sigma=0.8,x_0=1,epsilon=0.5. Compute x_t and coefficient SNR. State what fails if sigma is set to zero in that SNR formula.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Use amplitudes in the sample equation and their squares in the ratio.
Compare with the solution
The sample is 0.6×1+0.8×0.5=1.0. Coefficient SNR is 0.36/0.64=9/16=0.5625. At sigma zero, ordinary finite division is undefined and the positive-signal limiting ratio diverges; endpoint behavior must be handled explicitly.
Keep the idea
Take it with you
- Fix the process, cumulative coefficients, and data normalization first.
- Conditional variance, marginal variance, and realized samples are different.
- SNR and target conversions have explicit nonzero-coefficient domains.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.