Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The bijector menu for coupling

Affine, mixture-CDF, deep-sigmoid, rational-quadratic spline — the per-coordinate transforms a coupling layer can wrap, and what each buys

01 — The bijector menu for coupling

Notebook 00 showed the coupling contract — triangular Jacobian, free log-det, analytic inverse — holds for any elementwise monotone bijector TT. The bijector and the conditioner are independent choices: this notebook fixes the conditioner (a small MLP) and tours the TT menu that gauss_flows offers. The choice sets how much each coupling layer can bend a coordinate.

bijectorT(xB)T(x_B)inverselineage
affines xB+ts\,x_B + tclosed formRealNVP Dinh et al. (2017)
mixture-CDFΦ−1 ⁣(∑kπkΦ(xB;μk,σk))\Phi^{-1}\!\big(\sum_k\pi_k\Phi(x_B;\mu_k,\sigma_k)\big)root-findPart 1 01
deep-sigmoidcascaded σ-shiftsroot-findNAF-style
RQ-splinepiecewise rational-quadraticclosed formNSF Durkan et al. (2019)

What you will see

1. Each bijector is a per-coordinate monotone map

In a 2-D coupling the active coordinate x1x_1 is transformed conditioned on the passive x0x_0. Fix x0x_0 and sweep x1x_1: the bijector traces a 1-D monotone map x1↦z1x_1 \mapsto z_1. Its shape is the bijector’s expressiveness.

nonlinearity (max deviation from a straight line):
  affine       : 0.000
  mixture-CDF  : 0.258
  deep-sigmoid : 0.750
  RQ-spline    : 0.151
<Figure size 640x500 with 1 Axes>

Affine is a straight line — a coupling layer with an affine TT can only scale and shift a coordinate (nonlinearity ≈0\approx 0). The mixture-CDF and rational-quadratic spline bend into smooth monotone S-curves; the deep-sigmoid bends most aggressively (and can get steep). All stay monotone — they must, to be invertible.

2. Expressiveness is the family of maps the conditioner can dial

The conditioner reads x0x_0 and emits TT’s parameters, so as x0x_0 varies the layer sweeps a whole family of 1-D maps. That family is the layer’s true capacity. For affine the family is all lines (the conditioner only picks slope and intercept); for the spline it is a family of arbitrary monotone curves.

<Figure size 1100x460 with 2 Axes>

The affine panel is a sheaf of straight lines — every coordinate map the layer can produce is linear, so non-linear dependence must be built up across many stacked layers. The spline panel is a sheaf of distinct curves: a single layer can model a non-linear, context-dependent transform. That is why expressive bijectors need fewer layers.

3. Expressiveness in practice

We make this concrete: fit a small flow (2 coupling blocks) with each bijector on a spiral and compare held-out log-likelihood. With so few blocks, the per-bijector expressiveness — not depth — decides the fit.

affine       : log p = -2.177
mixture-CDF  : log p = -1.564
deep-sigmoid : log p = -2.421
RQ-spline    : log p = -1.471
<Figure size 700x430 with 1 Axes>

The rational-quadratic spline and mixture-CDF fit the spiral best — their expressive per-coordinate curves capture the bend in just two blocks. Affine lags: linear per-coordinate maps need more depth to compose the same shape. Deep-sigmoid is expressive in principle (its 1-D map bent the most in §1) but its steep, unbounded maps make it the hardest to optimise here — a reminder that raw flexibility is not the same as trainability. We compare the weakest and strongest densities.

<Figure size 1450x460 with 3 Axes>

Recap

bijectorper-coordinate mapinversenotes
affinelinear (s x+ts\,x+t)closed formcheapest; RealNVP; needs depth for non-linearity
mixture-CDFsmooth monotone Sroot-findreuses Part 1’s marginal; analytic log-det
deep-sigmoidcascaded σroot-findvery flexible, but steep & harder to train
RQ-splinepiecewise rational-quadraticclosed formNSF; expressive and exactly invertible — the modern default

The bijector sets per-layer expressiveness; the spline’s closed-form inverse and analytic log-det (Part 1 02) make it the usual choice. But the other half of a coupling layer — the conditioner — is where most of the modelling power lives.

Next up. 02 — Conditioner architectures: the network that reads xAx_A and emits θ is the expressive engine; we tour MLP / shared-MLP / ResNet conditioners, output clamping for stability, and the parameter-budget-vs-expressiveness trade-off.

References
  1. Dinh, L., Sohl-Dickstein, J., & Bengio, S. (2017). Density Estimation using Real NVP. International Conference on Learning Representations (ICLR).
  2. Durkan, C., Bekasov, A., Murray, I., & Papamakarios, G. (2019). Neural Spline Flows. Advances in Neural Information Processing Systems (NeurIPS).