Before you use the demo in the newer notebook, say what you expect to change.
Foundation reference
Normalizing Flows: Exact Likelihood via Invertible Transforms
Discrete normalizing flows give exact log-likelihoods, unlike GANs, and sample by transforming a base draw without Markov chain sampling, which energy-based models typically use. Continuous flows require numerical ODE integration for sampling and likelihood evaluation.
Study guide
Where to start
Why must a flow be invertible and also have a Jacobian determinant that is cheap to compute, and how do coupling layers and autoregressive flows achieve both?
How to study this pagePredict · Check · Generalize · Continue
Compare what the notebook demo shows with the key equation here and with the papers cited below.
Identify the part of the idea that survives a change of notation or model, so you can recognize it in another paper or system.
The newer notebook covers the same concept and has an interactive demo.
Why It Matters for Modern Models
- Discrete normalizing flows give exact log-likelihoods, unlike GANs, and sample by transforming a base draw without Markov chain sampling, which energy-based models typically use. Continuous flows require numerical ODE integration for sampling and likelihood evaluation.
- Continuous normalizing flows are the model class that flow matching trains, so flows are the direct ancestor of flow-matching generators (Lipman et al., 2023).
- The requirements of invertibility and a cheap Jacobian determinant explain the shape of flow architectures such as coupling and autoregressive layers.
Questions to Think About
- A VAE optimizes a lower bound on log p(x) while a flow computes it exactly; what does the flow pay for that exactness?
- How does flow matching avoid Jacobian determinants during training, and why is the flow it learns not, in general, the optimal transport map?
Interactive Demo
The interactive demo for this concept is in the newer notebook.
Core Math
If you prefer intuition first, try the demo in the newer notebook, then come back for the math.
Normalizing flows transform a simple base distribution , usually a standard Gaussian, through an invertible, differentiable function :
The change-of-variables formula gives the exact log-likelihood:
Composition. For with , and , the log-determinants add up:
The minus sign appears because these are the Jacobians of the forward maps, from noise toward data; it is the same formula as above. Coupling layers make each Jacobian triangular, so its determinant is just the product of the diagonal (Dinh et al., 2017).
Continuous flows. In the limit of many small steps, a flow becomes an ordinary differential equation , whose log-density changes by along the path (Chen et al., 2018). Flow matching trains such a velocity field by regression, without integrating the equation during training (Lipman et al., 2023).