Last modified: 7 Oct 2025 This note is organized during the study of the "Introduction to Flow Matching and Diffusion Models" course (https://diffusion.csail.mit.edu/). The content is derived from course notes, lectures and labs. I reorganized the material for my own understanding. The lab parts should be viewed with the source code for a comprehensive understanding since I didn’t show most utility functions.
We represent the objects we want to generate as vectors.
How good an image is $\approx$ How likely it is under data distribution.
Distribution of data we want to generate: Probability Density $p_{data}: \mathbb{R}^d \rightarrow \mathbb{R}{\ge0}, \ \ \ z\mapsto p{data}(z)$
A generative model converts samples from a initial distribution (e.g. Gaussian) into samples from the data distribution.

Trajectory $X: [0, 1] \rightarrow \mathbb{R}^d, \ \ \ t \mapsto X_t$ (a solution to ODE)
Stochastic Process $(X_t)_{0 \le t \le 1}$ is given by:
Vector Field $u: \mathbb{R}^d \times [0,1] \rightarrow \mathbb{R}^d, \ \ \ (x,t) \mapsto u_t(x)$ (defines an ODE)
Vector Field $u: \mathbb{R}^d \times [0,1] \rightarrow \mathbb{R}^d+\sigma, \ \ \ (x,t) \mapsto u_t(x)$
$\\sigma:[0, 1]\\rightarrow\\mathbb{R}_{\\ge 0},\\ \\ \\ t \\mapsto \\sigma_t\\ \\ \\ (diffusion\\ coefficient)$
Brownian motion:
Ordinary Differential Equation: describe conditions of a trajectory
not differentiable…

From ODE to Stochastic Differential Equation (SDE):
$\Rightarrow$ extend to SDE to encourage more exploration (the origin!!):
