All projects Generative Models

Normalizing Flows

Exact densities through invertible, differentiable transformations.

Study & implementation 2023 Change of variablesInvertible netsNeural ODEs
Normalizing Flows diagram

Motivation

Normalizing flows build a complex distribution by pushing a simple base density through a sequence of invertible maps. Unlike VAEs or GANs, they give an exact likelihood — the price is that every layer must be invertible with a tractable Jacobian determinant.

Method

The change-of-variables formula converts a base density into the model density. Architectures such as coupling layers and autoregressive flows are engineered so the Jacobian is triangular, making its determinant cheap to compute.

\[ \log p_X(x) = \log p_Z\!\big(f(x)\big) + \log\left|\det \frac{\partial f}{\partial x}\right| \]

Mathematical core

In the continuous limit a flow becomes a Neural ODE: the transformation is the solution of an ordinary differential equation, and the log-density evolves by the instantaneous change-of-variables (an integral of the vector field's divergence). This is exactly the homeomorphism-interpolation perspective I care about — flows deform space continuously while preserving its topology.

\[ \frac{\partial \log p(z(t))}{\partial t} = -\,\mathrm{tr}\!\left(\frac{\partial f}{\partial z(t)}\right) \]