Tutorials › Model training
Chapter 1 — From data to supervision
In Forward diffusion, we derived a formula for particle motion from clean data to pure noise. Since this process is known, we can apply it programmatically to corrupt real images and generate supervision for training.
In practice, we discretize a continuous sample path into a chain of progressively noisier states:
where is a real image from the dataset and the final state is pure noise.
You might expect that we should explicitly generate the full chain for each . But in practice, each iteration usually samples a single random time . The model then sees one pair: for example or , depending on the exact training objective.
But why not train on the entire chain? Isn't more training data always better?
In practice, training has a finite budget of iterations. Spending many consecutive updates on one chain from a fixed gives highly correlated examples. Sampling fresh pairs each iteration typically covers the space more efficiently under the same budget. With enough compute, you would still eventually visit the full chain anyway.
To express , don't we need to express all ? If so, isn't it a waste to not train on ?
For DDPM-style forward processes, we can sample directly from and via a closed-form distribution, so we do not need to explicitly generate all first.
The overall training data generation algorithm
- Draw from the training set.
- Draw a random time step .
- Corrupt into using the forward motion.
- Train the model to predict the denoising target associated with (more on objectives soon).