Layers that are invertible and have a cheap Jacobian determinant: coupling and autoregressive layers, Glow's invertible 1×1 convolutions, spline couplings, multi-scale flows for images, and conditional flows inside a VAE.
A 64×64 colour image has d=64⋅64⋅3=12288 coordinates. A flow on such images needs, for every layer and every training example, the log-determinant of a 12288×12288 Jacobian. By elimination that costs about 32d3≈1.2⋅1012 operations. The previous note found the way out: a triangular Jacobian. How do we build such layers and still let arbitrary networks do the heavy lifting inside them?
One layer maps z∈Rd to z′∈Rd, with Jacobian entries Jij=∂zi′/∂zj. Subscripts index coordinates, z<i=(z1,…,zi−1), and ⊙ is the element-wise product. The inverse layer has the reciprocal determinant, so a cheap determinant is cheap in both directions.
Split the input into two parts, z=(za,zb) with za∈Rk and zb∈Rd−k, and define
za′zb′=za,=zb⊙exp(s(za))+t(za),
where s,t:Rk→Rd−k are arbitrary neural networks, the scale and translation networks. This is an affine coupling layer (Dinh, Sohl-Dickstein and Bengio, 2017).
Figure
An affine coupling layer and its inverse
The first half is copied unchanged and fed to the networks s and t. The second half is multiplied element-wise by exp(s) and shifted by t. The inverse undoes only this element-wise step, evaluating s and t again on the same first half.
Each block of the Jacobian follows from the definition. The first part is copied, so its block is the identity and it does not depend on zb. Coordinate i of zb′ involves only coordinate i of zb, and s, t do not read zb at all, so the derivative with respect to zb,j is esi(za) when j=i and zero otherwise:
The determinant is positive, and the dense block never enters it, so s and t can be as deep as we like. With d=6 split 3+3 and s(za)=(0.2,−0.5,0.1) at some point, log∣detJ∣=−0.2 and detJ=e−0.2≈0.819: near that point the layer shrinks small volumes by about 18%, whatever the dense block contains.
Figure
Why the coupling Jacobian is lower-triangular
Jacobian of a coupling layer with d = 6 split 3 + 3; entry (i, j) is the derivative of output i with respect to input j. Everything above the diagonal (hatched) is zero, so the determinant is the product of the diagonal: three ones and exp(sᵢ). The dense block never enters it.
The inverse reverses only the element-wise step. Since za′=za, the networks can be evaluated again on the same input:
zazb=za′,=(zb′−t(za′))⊙exp(−s(za′)).
Neither s nor t is ever inverted, so the layer is invertible for any networks, and both directions cost one pass.
NICE (Dinh, Krueger and Bengio, 2015) uses the additive coupling zb′=zb+t(za), the case s≡0 with detJ=1, and ends with a diagonal scaling layer that can change volume. Since za passes through unchanged, consecutive layers swap the halves or permute the coordinates; Glow generalizes the permutation to a learned invertible channel mixture (part C).
An autoregressive model with Gaussian conditionals is already a flow (Papamakarios, Pavlakou and Murray, 2017, §3.1). In this part a layer connects a data-side vector x to a base-side vector u. Let
p(x)=i=1∏dN(xi;μi(x<i),e2αi(x<i)),
where μi and αi (a log standard deviation) are any functions of the earlier coordinates. Sampling draws u∼N(0,I) and computes xi=uieαi+μi one coordinate after another. Solving for u gives the inverse map, whose Jacobian is triangular because ui depends on x1,…,xi only:
The change of variables, logp(x)=logpU(u)+log∣det∂u/∂x∣, gives back ∑i[logφ(ui)−αi]=∑ilogN(xi;μi,e2αi), the likelihood of the autoregressive model, as it should.
A masked autoregressive flow (MAF) stacks such layers, reordering the coordinates between them. Its μi and αi read data-side coordinates, all known when we evaluate a density, so one network pass gives them all; sampling needs x1 before μ2(x1), so it takes d sequential passes.
An inverse autoregressive flow (IAF; Kingma et al., 2016) lets the shift and scale read the base side, xi=uieαi(u<i)+μi(u<i): sampling takes one pass and the density of a given x takes d. IAF still scores its own samples in one pass, because their u is known, which is all variational inference needs.
A coupling layer is the special case in which μi=αi=0 for i≤k and every later μi, αi reads only x1,…,xk (Papamakarios, Pavlakou and Murray, 2017, §3.3). Both directions then take one pass, at the price of changing only part of the coordinates per layer.
In the layer notation of part A, with z on the data side, the density direction of MAF reads zi′=ziesi(z<i)+ti(z<i), with si=−αi and ti=−μie−αi. MAF computes all (si,ti) with one network, MADE, whose weights are masked so that output i never sees inputs i,…,d (Germain et al., 2015). Every unit gets a degreem(⋅): input j and output i have degrees j and i, and each hidden unit u gets m(u)∈{1,…,d−1}, the number of leading inputs it may depend on. A hidden unit reads units of degree at most its own; an output reads only hidden units of strictly smaller degree:
Entry (i,j) of the product counts the paths from input j to output i. It is strictly lower-triangular, and a nonlinearity cannot create a path that the masks removed, so si and ti depend on z<i only; output 1 receives nothing and is a learned constant.
Figure
Masked weights make the network autoregressive
Input j has degree j and hidden units have degrees from 1 to d − 1 = 2; hidden unit u reads input j only if m(j) ≤ m(u), and output i reads unit u only if m(u) < i. Only surviving connections are drawn: sᵢ and tᵢ depend on z₁, …, zᵢ₋₁ only, and the Jacobian is lower-triangular.
One affine autoregressive layer can only produce Gaussian conditionals: given x<i, xi is an affine function of the Gaussian ui. Take a toy target shaped like an X: x1∼N(0,1) and x2=±x1+0.1ε with a random sign and ε∼N(0,1). With unlimited data, maximum likelihood picks the Gaussian with the conditional mean m and variance V of x2 given x1 (steps below). The random sign makes m=0, and V=E[x22∣x1]=x12+0.01, so μ2(x1)=0 and e2α2(x1)=x12+0.01. At x1=2 the model puts its peak at x2=0, with density 0.199, where the data have essentially none (5.5⋅10−87); at the data point x2=2 it gives 0.121 against the true 1.99.
Derivation
With unlimited data, maximum likelihood minimizes the expected negative log-density under the true conditional. Splitting E[(x2−μ)2∣x1] into variance plus squared bias gives
Setting the derivatives in μ and σ2 to zero gives μ=m and σ2=V.
Stacking layers with intervening permutations removes the single-layer Gaussian-conditional restriction: each layer models the transformed variables of the previous one. The five-layer result in Papamakarios, Pavlakou and Murray (2017), Fig. 1, uses a different, banana-shaped target; it is not a training result for our X-shaped example. Another approach is a more flexible element-wise map, part D.
The permutation between couplings is a linear map with a fixed matrix; Glow replaces it with a learned invertible linear map (Kingma and Dhariwal, 2018, §3.2). On an image tensor of height h, width w and C channels, a 1×1 convolution applies the same C×C matrix W to the channel vector of every pixel.
Ordered pixel by pixel, the Jacobian is block-diagonal with hw copies of W, since each output pixel reads only its own input pixel. It is the product of hw matrices that each apply W to one pixel and leave the rest alone, each with determinant detW, so
log∣detJ∣=h⋅w⋅log∣detW∣.
A general detW costs O(C3). Glow stores W in factored form,
W=PL(U+diag(s)),
where P is a fixed permutation matrix, L is lower-triangular with ones on its diagonal, U is strictly upper-triangular and s∈RC. The determinant of a product is the product of determinants; a permutation matrix has determinant ±1, since each row swap flips the sign; a triangular matrix has the product of its diagonal (properties of the determinant). So
That costs O(C). Applying W−1=(U+diag(s))−1L−1P⊤ to one vector takes a permutation and two triangular solves, O(C2); constructing the full inverse is generally O(C3). Allowing the permutation to vary, this factorization covers every invertible matrix: elimination with row exchanges gives P′W=LU′ (row exchanges and pivoting), so W=P′⊤LU′, and U′ splits into its strictly upper part and its diagonal. Glow draws a random orthogonal matrix, factors it once, then keeps P fixed and trains L, U and s. That fixed choice of P covers only its factorization chart, not every invertible matrix.
Figure
Glow's invertible 1×1 convolution
At every pixel the vector of C channel values is multiplied by the same learned C × C matrix W = P L (U + diag s), drawn for C = 4 and P = I. L has ones on its diagonal. The right factor, labelled U in the drawing, is U + diag s of the text: the strictly upper-triangular part U and the highlighted diagonal s. So log|det W| = Σ log|s_c|; the layer's log-determinant is h·w times that.
Expanding detW directly gives −1.5=2⋅(−0.5)⋅1.5, so log∣detW∣=log1.5≈0.405. The negative entry s2=−0.5 shows why the absolute value is needed.
A free sc can cross zero, where W is singular; learning log∣sc∣ with fixed signs rules this out. Some such restriction is unavoidable: det is continuous in the entries, so by the intermediate value theorem every path from det>0 to det<0 meets a singular matrix, and an always-invertible parametrization over a connected space such as Rn fixes the sign of detW (Papamakarios et al., 2021, §3.2).
Optional depth: a more flexible element-wise map. The rest of the note does not depend on it.
An affine map shifts and stretches a conditional distribution but keeps a unimodal one unimodal. The triangular argument needs only a strictly increasing, differentiable map gθ with a computable inverse; the diagonal entry of J becomes gθ′(zb,i), with θ=NN(za).
Neural spline flows use a monotone rational-quadratic spline (Durkan et al., 2019, §3.1), after Gregory and Delbourgo (1982). The scalar map is the identity outside [−B,B]; inside, K bins are fixed by K+1 increasing knots (xk,yk) from (−B,−B) to (B,B) and positive slopes δk at the knots, with δ0=δK=1 to match the tails. In bin k, with chord slope sk and position ξ,
At ξ=0 it gives yk; at ξ=1 the ratio of the quadratic parts is sk/sk=1, so the full increment is yk+1−yk and the result is yk+1. The denominator equals sk(ξ2+(1−ξ)2)+(δk+δk+1)ξ(1−ξ)>0. Differentiating the quotient gives
Write Δy=yk+1−yk, Δx=xk+1−xk, w=ξ(1−ξ) and c=δk+1+δk−2sk. Then g=yk+ΔyN/D with N=skξ2+δkw and D=sk+cw. Since dξ/dx=1/Δx and Δy/Δx=sk, the chain rule and the quotient rule give, with primes for d/dξ,
g′(x)=skD2N′D−ND′.
Here w′=1−2ξ, N′=2skξ+δkw′ and D′=cw′. Multiplying out, the two terms δkcww′ cancel:
because 2ξw−ξ2w′=2ξ2(1−ξ)−ξ2(1−2ξ)=ξ2. Substituting c and collecting powers of ξ turns the bracket into δk+1ξ2+2skξ(1−ξ)+δk(1−ξ)2, which gives the formula above.
The numerator terms are nonnegative, with at least one strictly positive at every point, so g increases. At the ends of the bin g′ equals δk and δk+1, so neighbouring pieces meet with the same slope. For each transformed coordinate the network outputs 3K−1 numbers: K widths and K heights, each passed through a softmax and multiplied by 2B, and K−1 inner derivatives passed through a softplus.
The inverse needs no iteration. Since g increases, the bin of an output y is found by comparing y with the yk. Setting g(x)=y and multiplying out the fraction gives a quadratic aξ2+bξ+c=0 with
whose root in [0,1] is ξ=2c/(−b−b2−4ac), the usual formula rewritten to avoid cancellation (Durkan et al., 2019, App. A).
Figure
A monotone rational-quadratic spline and its derivative
A toy spline with K = 4 bins on [−3, 3]: knots (−3, −3), (−1.2, −2.4), (0, 1.2), (1.5, 2.2), (3, 3), inner derivatives δ = (0.4, 2.5, 0.5) and δ = 1 at the edges. Left: each piece joins opposite corners of its bin's box; outside [−3, 3] the map is the identity. Right: g′(x). The point x = −0.6 maps to g = −1.025, g′ = 4.04.
In the toy spline of the figure, x=−0.6 lies in bin k=1 with ξ=0.5:
Quantity
Value
bin width, height, chord slope s1
1.2, 3.6, 3
knot derivatives δ1, δ2
0.4, 2.5
g(−0.6)
−2.4+3.06/2.225≈−1.025
g′(−0.6), its log
4.04, 1.40
inverse: a, b, c at y=−1.0247
5.097, 5.703, −4.126
recovered ξ and x
0.500, −0.6
This coordinate adds 1.40 to log∣detJ∣. Durkan et al. use B=3 and default to K=8, with exceptions noted for specific experiments (§5).
E. ActNorm: per-channel scale and shift with data-dependent initialization#
A normalization layer in a flow must be invertible with a known determinant. Batch normalization adds noise through its batch statistics, more so as the batch per device shrinks, and Glow trains on large images with one image per device (Kingma and Dhariwal, 2018, §3.1). Its ActNorm keeps an affine map per channel c, with a log-scale γc and a shift τc that do not depend on the batch:
zpqc′=eγczpqc+τc,
where p,q index the pixel. The Jacobian is diagonal, with eγc repeated at the hw pixels of channel c, so log∣detJ∣=hw∑cγc.
The parameters are initialized from the first minibatch so that each output channel has zero mean and unit variance on it, γc=−logstdc(z) and τc=−meanc(eγcz); afterwards they are ordinary trainable parameters. These formulas assume positive channel standard deviations; a constant channel needs a positive numerical floor rather than division by zero. One step of Glow is ActNorm, a 1×1 convolution and an affine coupling layer whose last convolution starts at zero, so that the coupling starts as the identity (§3.3).
F. Flows on images: squeeze, masks and multi-scale#
Convolutional networks for s and t need a split into za and zb that respects the pixel grid.
with the sum over all entries. Entries with b=1 play the role of za. A checkerboard mask sets b=1 where the row and column indices sum to an odd number, so the four neighbours of every transformed pixel condition it; a channel-wise mask sets b=1 on half of the channels. Consecutive layers alternate b and 1−b.
The squeeze cuts each channel into 2×2 squares and stacks the four values of a square as four channels, turning h×w×C into 2h×2w×4C (§3.6). With output channel 4c+2p+q holding offset (p,q) of channel c, a 4×4×1 input becomes
RealNVP’s block for one scale is three checkerboard couplings, a squeeze and three channel-wise couplings (§3.6). After each block, half of the variables are factored out into the latent z, and only the other half continues. With Φ(i) the block of scale i and h(0)=x, in the data-to-latent direction,
The last scale has four checkerboard couplings and no squeeze, and the recursion stops at a 4×4×C input (§4.1). For a 64×64×3 image:
Scale
Input
After squeeze
Factored out
Continues
1
64×64×3
32×32×12
6144
32×32×6
2
32×32×6
16×16×24
3072
16×16×12
3
16×16×12
8×8×48
1536
8×8×24
4
8×8×24
4×4×96
768
4×4×48
5
4×4×48
none
768
The factored-out parts add up to 12288=d: the latent keeps every dimension, but the 28 couplings process 6(1+21+41+81)+4⋅161=11.5 images’ worth of variables, about 41% of 28 full-size couplings. Glow keeps this skeleton, couples only along channels and puts its 1×1 convolutions in place of fixed permutations (Kingma and Dhariwal, 2018, §3).
Interpolating and encoding with the exact inverse#
A flow has an exact encoder: each image x has exactly one latent z=f−1(x).
To interpolate, encode two images and decode points on a path between z1 and z2. The straight line leaves the region where the base puts its mass: ∥z∥ concentrates near d with a spread of about 0.71 (the Gaussian shell), while the midpoint of two independent draws has variance 21 per coordinate and length near d/2, 78.4 instead of 110.9 for d=12288. Weights whose squares sum to one, such as cos4πz1+sin4πz2, keep the length near d.
Glow samples at a reduced temperature, multiplying the base standard deviation by T=0.7 (§6). For a volume-preserving flow the determinant is constant, so pθ(x)∝exp(−∥f−1(x)∥2/2), and the tempered base gives exp(−∥f−1(x)∥2/(2T2))∝pθ(x)1/T2, a sharpened model; the paper writes the exponent as T2.
An exact likelihood does not tell whether an outside image looks like the training data: the evaluated flow, VAE and PixelCNN models trained on CIFAR-10 give higher likelihood to unseen SVHN house numbers (Nalisnick et al., 2019).
A flow can be conditioned on a vector c that it does not transform: the networks inside read c as an extra input, as in s(za,c), t(za,c) or μi(x<i,c) (Papamakarios, Pavlakou and Murray, 2017, §3.4). The Jacobian is taken in the transformed variable at fixed c, so it stays triangular with the same log-determinant. A conditional flow is thus an exact density p(x∣c), and inside a VAE it can replace any of the three Gaussians.
As the approximate posterior q(z∣x), an IAF reads a context vector from the encoder and subtracts each step’s log-determinant from logq (Kingma et al., 2016, Algorithm 1). As the prior p(z), MAF’s density direction scores the encoder’s codes in one pass. Changing the variable of the ELBO from z to the flow’s base variable shows that such a prior is equivalent to an IAF posterior followed by a deeper decoder (Chen et al., 2017, §3.2).
Derivation
Let ϵ=h(z) be the autoregressive map of the prior, from code to base, so that by the change of variables p(z)=N(h(z);0,I)∣detJh(z)∣. Let q~(ϵ∣x) be the density of ϵ=h(z) when z∼q(z∣x); by the same formula q~(ϵ∣x)=q(z∣x)∣detJh(z)∣−1. In the difference of logarithms the determinant cancels:
This is the ELBO of a VAE with a standard normal prior on ϵ, the posterior q~ and the decoder p(x∣h−1(ϵ)). Coordinate i of h(z) is (zi−μi(z<i))e−αi(z<i), an affine function of zi with coefficients read from z<i: the form of an IAF step. So q~ is q followed by an IAF, and h−1 has moved into the decoder.
As the likelihood p(x∣z), a conditional flow replaces the pixel-wise Gaussian decoder. VAPNEV (Agrawal and Dukkipati, 2016) maps an image x to a vector y=gz(x) of the same size by RealNVP coupling layers whose networks also read z, and puts a Gaussian with decoder-predicted parameters on y. By the change of variables,
which enters the ELBO in place of the squared reconstruction error. It is an exact density of the whole image given the code, so it can model dependencies between pixels as far as the couplings can express them, while the pixel-wise Gaussian makes them independent. To sample, draw z from the prior, y from N(μ(z),diagσ2(z)), and compute x=gz−1(y).
G. Planar and radial flows: cheap determinants without triangles#
Optional depth: the older rank-one route to a cheap determinant. The rest of the note does not depend on it.
The planar construction of Rezende and Mohamed (2015) has a Jacobian equal to the identity plus a rank-one matrix. Its radial counterpart uses a scalar multiple of the identity plus a rank-one matrix. For a,c∈Rd, I+ac⊤ leaves every vector orthogonal to c unchanged, so d−1 eigenvalues equal 1; the trace d+c⊤a fixes the last one, and the product of the eigenvalues gives the matrix determinant lemma:
det(I+ac⊤)=1+c⊤a.
A planar flow with u,w∈Rd and a scalar b moves z along u by an amount that depends on its signed distance from the hyperplane w⊤z+b=0:
Taking w⊤ of y=f(z) reduces invertibility to one dimension. With η=w⊤z, w⊤y=η+w⊤utanh(η+b)=g(η), and once η is known, z=y−utanh(η+b). Since 0<tanh′≤1, g′(η)≥1+min(w⊤u,0), so for w⊤u>−1 the function g is strictly increasing; g(η)−η is bounded, so g is also onto R, and f is a bijection with detJ>0 (Rezende and Mohamed, 2015, App. A.1). The inverse still needs a scalar root search per layer. Below the bound the map can fold: g(η)=η−2tanhη (w⊤u=−2, b=0) vanishes at 0 and ±1.915.
A radial flowf(z)=z+β(z−z0)/(α+r), with r=∥z−z0∥ and α>0, moves the distance from z0 to ρ(r)=r(1+β/(α+r)), and detJ=(ρ/r)d−1ρ′(r), positive for β>−α (steps below; App. A.2). At r=0, use the continuous limit ρ/r=1+β/α. Unlike the planar case, the radial inverse is analytic: for output radius ρ, solve r2+(α+β−ρ)r−αρ=0 for its nonnegative root, then recover z=z0+(r/ρ)(y−z0). When ρ=0, simply return z0. Both families can enrich a variational posterior; the radial layer also permits a direct inverse.
Derivation
Write h(r)=β/(α+r), so that f(z)=z+h(r)(z−z0). Since ∇r=(z−z0)/r, the product rule gives the Jacobian, whose eigenvectors are the unit radial vector e=(z−z0)/r and every v orthogonal to it:
The last line uses ρ=r(1+h), so ρ′=1+h+rh′, which with h′=−β/(α+r)2 equals 1+αβ/(α+r)2. So the d−1 orthogonal directions are stretched by ρ(r)/r, the radial one by ρ′(r), and detJ=(ρ/r)d−1ρ′. For β>−α both factors are positive at every r≥0: 1+h>1−α/(α+r)≥0, and ρ′(r)≥min(1,1+β/α)>0 (App. A.2).
Two later routes avoid triangles too: residual flowsz+F(z) with a contraction F (Murphy, 2023, §23.2.5), and continuous-time flowsdz/dt=F(z,t), whose log-determinant changes at the rate trJF (Grathwohl et al., 2019); the continuous-time diffusion note builds on this view.
Pushing a grid through a layer shows where it stretches and squeezes space; ∣detJ∣ is the local factor.
Figure
The Jacobian measures how a layer warps space
One 2-D affine coupling layer applied to a square grid, with s(z₁) = 0.5 tanh z₁ and t(z₁) = 0.5 sin 1.5z₁. Vertical lines stay put because z′₁ = z₁; each vertical strip is stretched by exp(s(z₁)) and shifted by t(z₁). The highlighted cell grows by a factor 1.37, the average of |det J| over its strip.
Layer
Why detJ is cheap
log∣detJ∣
Fast directions
Affine coupling
triangular, copied half
∑isi(za)
both
MAF
triangular, masks
−∑iαi(x<i), data to base
density
IAF
triangular, masks
∑iαi(u<i), base to data
sampling
Spline coupling
triangular, monotone pieces
∑ilogg′(zb,i)
both
1×1 convolution
W=PL(U+diag(s))
hw∑clog∣sc∣
both
ActNorm
diagonal
hw∑cγc
both
Squeeze, permutation
reordering
0
both
Planar
identity plus rank one
determinant lemma
forward; inverse needs root search
Radial
scalar identity plus rank one
(d−1)log(ρ/r)+logρ′(r)
both; inverse solves a quadratic
For d≥2, with sufficiently expressive, suitably regular scale/shift networks, affine couplings and invertible linear layers are distributionally universal: from an absolutely continuous base, a sequence of such flows can converge weakly to any target distribution (Teshima et al., 2020, Theorem 3). This does not promise exact representation by a finite network, convergence of densities, or successful training. Approximations may require very steep maps (separated modes), and the latent never gets smaller than the data.
Run python3 scripts/notes/generative-practice.py flow-architectures. The standalone implementation composes a new two-dimensional affine coupling, a coordinate swap and nonzero diagonal scaling. With latent coordinates (a,b), its output is
x1x2=1.3(e0.3ab+0.2a2)−0.4,=0.7a+0.2.
Recover a from x2, then recover b from x1. On three specified input points, the saved round trip agrees within 10−12. The parameters are fixed, so this checks the implementation rather than a training run.
Add the layers’ log absolute determinants: log(1.3⋅0.7)+0.3a. Compare with a central finite-difference Jacobian; the largest discrepancy is below 10−8. The swap reverses orientation, so taking the logarithm of the signed determinant would be invalid.
Compute each output’s log density from its recovered Gaussian latent and this determinant. Setting either diagonal scale to zero would destroy invertibility; it is outside the tested model. No external flow library, image data, spline implementation or checkpoint is used.
The example, script and observations were newly authored for this course with Codex assistance; the numerical results are from the linked run.
Flows buy an exact likelihood by restricting the architecture. An energy-based model drops these restrictions: any network Eθ(x) with a scalar output defines a density e−Eθ(x)/Zθ, provided Zθ=∫e−Eθ(x)dx is finite. Its value is unknown, so the next note builds Markov chain Monte Carlo samplers that need the density only up to Zθ.
L. Dinh, J. Sohl-Dickstein, S. Bengio. Density estimation using Real NVP. ICLR, 2017. §3.4 (masks), §3.6 (squeeze and multi-scale architecture), §4.1 (architecture).
G. Papamakarios, T. Pavlakou, I. Murray. Masked autoregressive flow for density estimation. NeurIPS, 2017. §3.1 (autoregressive models as flows), §3.3 (relation to Real NVP), §3.4 (conditional MAF).
X. Chen, D. P. Kingma, T. Salimans, Y. Duan, P. Dhariwal, J. Schulman, I. Sutskever, P. Abbeel. Variational lossy autoencoder. ICLR, 2017. §3.2 (autoregressive flow prior).