normalizing flows

**Normalizing Flows** are a class of **generative models that learn invertible transformations between a simple base distribution (typically Gaussian) and complex data distributions, uniquely providing exact density estimation and efficient sampling through the change of variables formula** — the only deep generative model family that offers both tractable likelihoods and one-pass sampling, making them indispensable for scientific applications requiring precise probability computation such as molecular dynamics, variational inference, and anomaly detection. **What Are Normalizing Flows?** - **Core Idea**: Transform a simple distribution $z sim mathcal{N}(0, I)$ through a sequence of invertible functions $f_1, f_2, ldots, f_K$ to produce complex data $x = f_K circ cdots circ f_1(z)$. - **Exact Likelihood**: Using the change of variables formula: $log p(x) = log p(z) - sum_{k=1}^{K} log |det J_{f_k}|$ where $J_{f_k}$ is the Jacobian of each transformation. - **Invertibility**: Every transformation must be invertible — given data $x$, we can recover the latent $z = f_1^{-1} circ cdots circ f_K^{-1}(x)$. - **Tractable Jacobian**: The Jacobian determinant must be efficiently computable — this constraint drives architectural design. **Why Normalizing Flows Matter** - **Exact Likelihoods**: Unlike VAEs (approximate ELBO) or GANs (no likelihood), flows compute exact log-probabilities — critical for model comparison and anomaly detection. - **Stable Training**: Maximum likelihood training is stable and well-understood — no mode collapse (GANs) or posterior collapse (VAEs). - **Invertible by Design**: The latent representation is bijective with data — every data point has a unique latent code and vice versa. - **Scientific Computing**: Exact densities are required for molecular dynamics (Boltzmann generators), statistical physics, and Bayesian inference. - **Lossless Compression**: Flows with exact likelihoods enable theoretically optimal compression algorithms. **Flow Architectures** | Architecture | Key Innovation | Trade-off | |-------------|---------------|-----------| | **RealNVP** | Affine coupling layers with triangular Jacobian | Fast but limited expressiveness per layer | | **Glow** | 1×1 invertible convolutions + multi-scale | High-quality image generation | | **MAF (Masked Autoregressive)** | Sequential autoregressive transforms | Expressive density but slow sampling | | **IAF (Inverse Autoregressive)** | Inverse of MAF | Fast sampling but slow density evaluation | | **Neural Spline Flows** | Monotonic rational-quadratic splines | Most expressive coupling, excellent density | | **FFJORD** | Continuous-time flow via neural ODEs | Free-form Jacobian, memory efficient | | **Residual Flows** | Contractive residual connections | Flexible architecture, approximate Jacobian | **Applications** - **Variational Inference**: Flow-based variational posteriors (normalizing flows as flexible approximate posteriors) dramatically improve VI quality. - **Molecular Generation**: Boltzmann generators use flows to sample molecular configurations with correct thermodynamic weights. - **Anomaly Detection**: Exact log-likelihoods enable principled outlier detection by flagging low-probability inputs. - **Image Generation**: Glow generates high-resolution faces with meaningful latent interpolation. - **Audio Synthesis**: WaveGlow and related flow models generate high-quality speech in parallel. Normalizing Flows are **the mathematician's generative model** — trading the architectural flexibility of GANs and VAEs for the unique guarantee of exact, tractable probability computation, making them the method of choice whenever knowing the precise likelihood of your data matters more than generating the most visually stunning samples.

Go deeper with CFSGPT

Get AI-powered deep-dives, save terms, and run advanced simulations — free account.

Create Free Account