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.

Equation bank

This page is generated by scripts/equations.py (uv run poe equations); do not edit it by hand. It lists every display equation of the tutorials once, with the label a page uses to reference it ([](#eq-cov-nd)) and the section that derives it. Each equation is written in exactly one place, and every other page links to it by its label.

Notation

Symbols keep one meaning across the tutorials. Shapes use DxD_x for the dimension of the data and of the latent, which a bijection keeps equal. In code gives the dimension name a notebook’s jaxtyping annotations use for the symbol (Float[ArrayLike, "sample state"]).

SymbolMeaningShapeIn code
x\vect{x}input, a data pointRDx\mathbb{R}^{D_x}state
z\vect{z}latent, the Gaussianized pointRDx\mathbb{R}^{D_x}latent
DxD_xdimension of the data and of the latent, which a bijection keeps equalN\mathbb{N}state, latent
x,zx, zinput and latent in one dimensionR\mathbb{R}state, latent
ffthe invertible map from data to latent, z=f(x)\vect{z} = f(\vect{x}); a conditional flow’s map f(x;y)f(\vect{x}; \vect{y}) is invertible in x\vect{x} for each context y\vect{y}——
f′(x)f'(x)derivative of a 1-D mapR\mathbb{R}—
Jf(x)\mat{J}_f(\vect{x})Jacobian of ff at x\vect{x}, rows are outputsRDx×Dx\mathbb{R}^{D_x \times D_x}—
px,pzp_x, p_zdensities of the input and of the latent——
N(z;0,I)\mathcal{N}(\vect{z}; \vect{0}, \mat{I})standard-normal density, the base of every flow hereR>0\mathbb{R}_{>0}—
I\mat{I}identity matrixRDx×Dx\mathbb{R}^{D_x \times D_x}—
A,b\mat{A}, \vect{b}matrix and offset of an affine map; the weight of a 1×1 convolution, and ActNorm’s per-channel location; the generator and offset of a matrix-exponential layer, z=etAx+φ(t)b\vect{z} = e^{t \mat{A}} \vect{x} + \varphi(t) \vect{b}; in Part 6 also a square matrix whose trace is estimatedRDx×Dx,RDx\mathbb{R}^{D_x \times D_x}, \mathbb{R}^{D_x}—
M\mat{M}fixed mixing matrixRDx×Dx\mathbb{R}^{D_x \times D_x}—
fkf_klayer kk of a composed map f=fK∘…∘f1f = f_K \circ \ldots \circ f_1——
xk\vect{x}_kintermediate state after layer kk, x0=x\vect{x}_0 = \vect{x}, xK=z\vect{x}_K = \vect{z}RDx\mathbb{R}^{D_x}—
KKnumber of layers in a composed map, or of reflections in a Householder productN\mathbb{N}—
w,w1,w2w, w_1, w_2auxiliary standard-normal draws used to build toy dataR\mathbb{R}—
ddcoordinate index, d=1,…,Dxd = 1, \ldots, D_xN\mathbb{N}—
zdz_dcoordinate dd of z\vect{z}, with density pzdp_{z_d}, mean μd\mu_d and standard deviation σd\sigma_dR\mathbb{R}—
N,xnN, \vect{x}_nnumber of samples and sample nnN,RDx\mathbb{N}, \mathbb{R}^{D_x}sample
F,FdF, F_dCDF of a one-dimensional distribution, of coordinate dd of the data[0,1][0, 1]—
Φ,Φ−1\Phi, \Phi^{-1}standard-normal CDF and its inverse, the probit——
g(x)d=Φ−1(Fd(xd))g(\vect{x})_d = \Phi^{-1}(F_d(x_d))marginal Gaussianization, one coordinate at a time——
Q,Qk\mat{Q}, \mat{Q}_korthogonal rotation, Q⊤Q=I\mat{Q}^\top \mat{Q} = \mat{I}, of layer kkRDx×Dx\mathbb{R}^{D_x \times D_x}—
MMnumber of mixture componentsN\mathbb{N}component
wm,μm,σmw_m, \mu_m, \sigma_mweight, mean and scale of mixture component mmR≥0,R,R>0\mathbb{R}_{\ge 0}, \mathbb{R}, \mathbb{R}_{>0}—
τ\tauquantile level, τ=F(x)\tau = F(x)(0,1)(0, 1)quantile
x(n),x⋆x^{(n)}, x^\starbisection iterate after nn steps, and the rootR\mathbb{R}step
ε\varepsilonclamp that keeps a CDF inside [ε,1−ε][\varepsilon, 1 - \varepsilon] before the probitR>0\mathbb{R}_{>0}—
δ\deltatolerance of the round-trip testR>0\mathbb{R}_{>0}—
μx,Σx\gvect{\mu}_x, \gmat{\Sigma}_xmean and covariance of the inputRDx,RDx×Dx\mathbb{R}^{D_x}, \mathbb{R}^{D_x \times D_x}—
P(μx,Σx)\mathcal{P}(\gvect{\mu}_x, \gmat{\Sigma}_x)set of all densities with that mean and covariance——
H[p]\mathbb{H}[p]differential entropy of a density, in natsR\mathbb{R}—
Neg[p]\mathrm{Neg}[p]negentropy, the entropy gap to the Gaussian with the same mean and covarianceR≥0\mathbb{R}_{\ge 0}—
TC[pz]\mathrm{TC}[p_z]total correlation, the sum of marginal entropies minus the joint entropyR≥0\mathbb{R}_{\ge 0}—
γ1,d,γ2,d\gamma_{1,d}, \gamma_{2,d}skewness and excess kurtosis of coordinate ddR\mathbb{R}—
ED[pz]\mathrm{ED}[p_z]energy distance from pzp_z to N(0,I)\mathcal{N}(\vect{0}, \mat{I})R≥0\mathbb{R}_{\ge 0}—
m\vect{m}the data after one marginal Gaussianization onlyRDx\mathbb{R}^{D_x}—
TTone-dimensional marginal map, T=Φ−1∘FT = \Phi^{-1} \circ F——
F^N\hat{F}_Nempirical CDF of NN samples[0,1][0, 1]—
F^,p^x\hat{F}, \hat{p}_xestimated CDF of one coordinate and its density, p^x=F^′\hat{p}_x = \hat{F}'[0,1],R≥0[0, 1], \mathbb{R}_{\ge 0}—
U(0,1)\mathcal{U}(0, 1)uniform distribution on the unit interval——
λ,λN\lambda, \lambda_Ngap in the DKW inequality, and its 95% band at NN samplesR>0\mathbb{R}_{>0}—
L,lL, lnumber of bins of a histogram or a spline, and the bin or knot indexN\mathbb{N}bin, knot
NlN_lnumber of samples in histogram bin llN\mathbb{N}—
hhwidth of a histogram bin, or bandwidth of a kernelR>0\mathbb{R}_{>0}—
p^h\hat{p}_hkernel density estimate with bandwidth hh——
xnx_nsample nn of a one-dimensional datasetR\mathbb{R}—
BIC(M)\mathrm{BIC}(M)Bayesian information criterion of an MM-component mixtureR\mathbb{R}—
xl,zlx_l, z_linput and output knots of a splineR\mathbb{R}knot
BBhalf-width of the spline interval [−B,B][-B, B]R>0\mathbb{R}_{>0}—
ξ\xiposition of xx inside its spline bin[0,1][0, 1]—
ηl,sl,ωl\eta_l, s_l, \omega_lslope at knot ll, slope of bin ll, and ηl+1+ηl−2sl\eta_{l+1} + \eta_l - 2 s_lR>0,R>0,R\mathbb{R}_{>0}, \mathbb{R}_{>0}, \mathbb{R}—
q2,q1,q0q_2, q_1, q_0coefficients of the quadratic that inverts a rational-quadratic splineR\mathbb{R}—
θ\thetaparameters of a CDF or of a trainable layer——
L(θ)\mathcal{L}(\theta)mean negative log-likelihood of the dataR\mathbb{R}—
αm,ρm\alpha_m, \rho_munconstrained logit and raw scale of mixture component mmR\mathbb{R}—
F′(x),F′′(x)F'(x), F''(x)first and second derivative of a CDF FF, the first being its densityR\mathbb{R}—
an,bna_n, b_nbracket around the root after nn stepsR\mathbb{R}—
x~(n+1)\tilde{x}^{(n+1)}Newton proposal of the safeguarded hybridR\mathbb{R}—
CCconstant of quadratic convergenceR>0\mathbb{R}_{>0}—
sg,x^\mathrm{sg}, \hat{x}stop-gradient operator, and the one-step root——
Nt,Nv,NbN_t, N_v, N_bnumbers of training rows, held-out rows and points per batchN\mathbb{N}train, held_out, batch
θ^\hat{\theta}trained parameters, from the epoch with the best held-out loss——
KL[p∥q]\mathrm{KL}[p \Vert q]Kullback–Leibler divergence of pp from qqR≥0\mathbb{R}_{\ge 0}—
V,Λ\mat{V}, \gmat{\Lambda}principal axes (the columns of V\mat{V}) and the diagonal of variances along them, Σx=VΛV⊤\gmat{\Sigma}_x = \mat{V} \gmat{\Lambda} \mat{V}^\topRDx×Dx\mathbb{R}^{D_x \times D_x}—
G,R\mat{G}, \mat{R}a matrix of independent standard normal entries and the upper-triangular factor of its QR factorisationRDx×Dx\mathbb{R}^{D_x \times D_x}—
K,W\mat{K}, \mat{W}Picard’s whitening matrix and its orthogonal unmixing of the whitened dataRDx×Dx\mathbb{R}^{D_x \times D_x}—
UK,VK\mat{U}_K, \mat{V}_Kleft and right singular vectors of K\mat{K}RDx×Dx\mathbb{R}^{D_x \times D_x}—
u,uk\vect{u}, \vect{u}_knormal vector of a Householder reflection, of reflection kkRDx\mathbb{R}^{D_x}—
H(u)\mat{H}(\vect{u})Householder reflection across the hyperplane orthogonal to u\vect{u}, I−2uu⊤/∥u∥2\mat{I} - 2 \vect{u} \vect{u}^\top / \Vert \vect{u} \Vert^2RDx×Dx\mathbb{R}^{D_x \times D_x}—
Q⋆\mat{Q}_\startarget orthogonal matrix of a fitRDx×Dx\mathbb{R}^{D_x \times D_x}—
S,ψ\mat{S}, \psiskew-symmetric matrix, S=−S⊤\mat{S} = -\mat{S}^\top, the parameter of the Cayley map and the matrix exponential, and the angle in one of its eigenvalues ±iψ\pm i \psiRDx×Dx,R\mathbb{R}^{D_x \times D_x}, \mathbb{R}—
∥⋅∥F\Vert \cdot \Vert_FFrobenius norm——
L0(A),L⋆(Q)\mathcal{L}_0(\mat{A}), \mathcal{L}^\star(\mat{Q})the loss a flow reports when a free matrix’s log-determinant is booked as zero, and the best mean negative log-likelihood over a per-coordinate affine map after the rotation Q\mat{Q}R\mathbb{R}—
a,xˉ\vect{a}, \bar{\vect{x}}per-coordinate scales of an affine map, and the sample meanRDx\mathbb{R}^{D_x}—
PPnumber of positions of an image, each holding a channel vectorN\mathbb{N}—
L,U\mat{L}, \mat{U}unit lower-triangular and upper-triangular factors of A\mat{A}, the diagonal of U\mat{U} positiveRDx×Dx\mathbb{R}^{D_x \times D_x}—
Π\gmat{\Pi}a fixed permutation matrixRDx×Dx\mathbb{R}^{D_x \times D_x}—
s\vect{s}ActNorm’s positive per-channel scaleRDx\mathbb{R}^{D_x}—
x(n)x_{(n)}the nn-th smallest of the NN values of one coordinate (an order statistic)R\mathbb{R}—
F^k,d\hat{F}_{k,d}midpoint empirical CDF of coordinate dd of the state xk−1\vect{x}_{k-1}, fitted by RBIG layer kk[0,1][0, 1]marginal
ej,J\vect{e}_j, Junit direction jj of the JJ directions a projection test usesRDx,N\mathbb{R}^{D_x}, \mathbb{N}directions
F^N,j,KSmax⁡\hat{F}_{N,j}, \mathrm{KS}_{\max}empirical CDF of the projections ej⊤zn\vect{e}_j^\top \vect{z}_n, and the largest Kolmogorov–Smirnov distance of a projection to N(0,1)\mathcal{N}(0, 1)[0,1][0, 1]projection_ks
β\betastrength of the shear that bends a standard-normal cloud into a bananaR\mathbb{R}—
xk,dx_{k,d}coordinate dd of the state xk\vect{x}_k after RBIG layer kkR\mathbb{R}—
Δk,Δ⋆\Delta_k, \Delta_\starKL divergence removed by RBIG layer kk, the summed divergences of its input’s marginals from N(0,1)\mathcal{N}(0, 1), and the 95% quantile of its estimate on standard-normal dataR≥0\mathbb{R}_{\ge 0}traces, reduction_floor
us,xsu_{\mathrm{s}}, x_{\mathrm{s}}level and value of the seam above which a parametric tail replaces the empirical CDF, mirrored below 1−us1 - u_{\mathrm{s}}[0,1],R[0, 1], \mathbb{R}q_tail, seam
GGCDF of the generalised Pareto distribution fitted to the exceedances x−xsx - x_{\mathrm{s}} over the seam——
c,pcc, p_ca count, and the probabilities of the countsN\mathbb{N}counts
uuuniform noise added to a count to dequantise it, u∼U(0,1)u \sim \mathcal{U}(0, 1)[0,1)[0, 1)—
fθf_\thetaa flow from data to latent whose blocks have trainable parameters θ\theta; fθ(x;y)f_\theta(\vect{x}; y) when it reads a context—gaussianization_flow
κ\kappascale of the toy map fκ(x)=κxf_\kappa(\vect{x}) = \kappa \vect{x}R>0\mathbb{R}_{>0}scales
μz,σz\gvect{\mu}_z, \gvect{\sigma}_zlocation and scale of a trainable normal base, N(μz,diag(σz2))\mathcal{N}(\gvect{\mu}_z, \mathrm{diag}(\gvect{\sigma}_z^2))RDx,R>0Dx\mathbb{R}^{D_x}, \mathbb{R}^{D_x}_{>0}base_dist.loc, base_dist.scale
xA,xB\vect{x}_A, \vect{x}_Bthe passive half of a coupling layer’s input, which it copies, and the active half, which it transformsRDA,RDB\mathbb{R}^{D_A}, \mathbb{R}^{D_B}—
DA,DBD_A, D_Bsizes of the passive and active halves of a coupling, DA+DB=DxD_A + D_B = D_xN\mathbb{N}—
cϕc_\phithe conditioner of a coupling layer, a neural network with weights ϕ\phi that maps the passive half to the transformer’s parameters, θ=cϕ(xA)\theta = c_\phi(\vect{x}_A); a conditional coupling also reads the context, θ=cϕ(xA,y)\theta = c_\phi(\vect{x}_A, \vect{y})—nn_width, nn_depth
TθT_\thetathe transformer of a coupling layer, a monotone one-dimensional map with parameters θ\theta applied to each active coordinate——
μB,σB\gvect{\mu}_B, \gvect{\sigma}_Bshift and positive scale of an affine coupling’s active half, both functions of the passive halfRDB,R>0DB\mathbb{R}^{D_B}, \mathbb{R}^{D_B}_{>0}—
r0,t0r_0, t_0positive scale and shift of the linear part of a deep-sigmoid transformerR>0,R\mathbb{R}_{>0}, \mathbb{R}base_scale, bias
rm,km,tmr_m, k_m, t_mpositive amplitude, positive slope and shift of sigmoid unit mm of a deep-sigmoid transformerR>0,R>0,R\mathbb{R}_{>0}, \mathbb{R}_{>0}, \mathbb{R}amplitudes, slopes, shifts
ς\varsigmathe logistic sigmoid, ς(u)=1/(1+e−u)\varsigma(u) = 1 / (1 + e^{-u})——
bbthe bound on a mixture-CDF coupling’s log-scales, which pass through btanh⁡(u)b \tanh(u)R>0\mathbb{R}_{>0}log_scale_bound
Wout,bout\mat{W}_{\mathrm{out}}, \vect{b}_{\mathrm{out}}weight and bias of a conditioner’s readout layer; a fresh gauss_flows coupling has Wout=0\mat{W}_{\mathrm{out}} = \mat{0}, so its parameters are bout\vect{b}_{\mathrm{out}} whatever the copied half——
v(xA)\vect{v}(\vect{x}_A)output of the conditioner’s last hidden layer, the features the readout weighs——
rrresidual branch of a residual map y=x+r(x)y = x + r(x)——
ar,ωra_r, \omega_ramplitude and frequency of the toy residual branch r(x)=arsin⁡(ωrx)r(x) = a_r \sin(\omega_r x)R\mathbb{R}—
Lip(r)\mathrm{Lip}(r)Lipschitz constant of rr; the residual map is invertible when it is below 1R\mathbb{R}—
vθ(t,x)\vect{v}_\theta(t, \vect{x})vector field of a continuous flow, a neural network with weights θ\theta; in a latent ODE, the field of the latent stateRDx\mathbb{R}^{D_x}DiffeqMLP, vector_field
tttime of a continuous flow, from the latent at t=0t = 0 to the data at t=1t = 1; a matrix-exponential layer takes it as its condition through pack_time_control[0,1][0, 1]t_span
x(t)\vect{x}(t)state of the ODE at time tt, with x(0)=z\vect{x}(0) = \vect{z} and x(1)=x\vect{x}(1) = \vect{x}RDx\mathbb{R}^{D_x}—
Jv\mat{J}_vJacobian ∂vθ/∂x\partial \vect{v}_\theta / \partial \vect{x} of the vector field, whose trace is the divergenceRDx×Dx\mathbb{R}^{D_x \times D_x}—
ϵ,ϵi\gvect{\epsilon}, \gvect{\epsilon}_iprobe of Hutchinson’s estimator, with zero mean and E[ϵϵ⊤]=I\mathbb{E}[\gvect{\epsilon} \gvect{\epsilon}^\top] = \mat{I} (Rademacher or standard normal)RDx\mathbb{R}^{D_x}—
NpN_pnumber of Hutchinson probesN\mathbb{N}num_probes, n_hutchinson_samples, probe_count
tr^(A)\widehat{\mathrm{tr}}(\mat{A})Hutchinson’s estimate of the trace of A\mat{A} from NpN_p probesR\mathbb{R}—
ϵˉ12\bar{\epsilon}_{12}mean of ϵi,1ϵi,2\epsilon_{i,1} \epsilon_{i,2} over a 2-D FFJORD’s fixed Rademacher probes, which sets its trace error[−1,1][-1, 1]—
φ\varphitime gate of a matrix-exponential layer, a scalar function with φ(0)=0\varphi(0) = 0 (TimeIdentity, TimeTanh, TimeFourier)——
μ^x,Σ^x\hat{\gvect{\mu}}_x, \hat{\gmat{\Sigma}}_xsample mean and sample covariance (divided by NN) of the training rowsRDx,RDx×Dx\mathbb{R}^{D_x}, \mathbb{R}^{D_x \times D_x}—
z0,Dz\vect{z}_0, D_zcode of a latent ODE, the state of its latent ODE at t=0t = 0, and its dimensionRDz,N\mathbb{R}^{D_z}, \mathbb{N}code
X,Xn\mathcal{X}, \mathcal{X}_nobservations {(ti,xi)}i=1No\{(t_i, \vect{x}_i)\}_{i=1}^{N_o} of one trajectory, and of training trajectory nn——
ti,Not_i, N_oobserved times of one trajectory and their numberR,N\mathbb{R}, \mathbb{N}observation
decθ\mathrm{dec}_\thetadecoder of a latent ODE, with generative weights θ\theta shared with its field vθ\vect{v}_\theta——
vϕ,h,h′,Dh\vect{v}_\phi, \vect{h}, \vect{h}', D_hencoder’s vector field, a hidden activation (in Part 6 the encoder’s hidden state, in Part 7 the activation a conditioning layer modulates), the modulated activation, and the hidden dimension,RDh,RDh,N, \mathbb{R}^{D_h}, \mathbb{R}^{D_h}, \mathbb{N}hidden
x^(t)\hat{\vect{x}}(t)piecewise-linear path through one trajectory’s observationsRDx\mathbb{R}^{D_x}—
σobs\sigma_{\mathrm{obs}}fixed noise scale of a latent ODE’s observations; the noise standard deviation of an inverse problem’s observationR>0\mathbb{R}_{>0}—
qϕ(z0∣X),μϕ,σϕq_\phi(\vect{z}_0 \mid \mathcal{X}), \gvect{\mu}_\phi, \gvect{\sigma}_\phiencoder’s diagonal Gaussian posterior over the code, its mean and its standard deviations,RDz,R>0Dz, \mathbb{R}^{D_z}, \mathbb{R}^{D_z}_{>0}—
ε\gvect{\varepsilon}standard-normal draw of a reparametrised sample, z0=μϕ+σϕ⊙ε\vect{z}_0 = \gvect{\mu}_\phi + \gvect{\sigma}_\phi \odot \gvect{\varepsilon}; in Part 7, the noise of an observation, ε∼N(0,σobs2I)\gvect{\varepsilon} \sim \mathcal{N}(\vect{0}, \sigma_{\mathrm{obs}}^2 \mat{I})RDz,RDy\mathbb{R}^{D_z}, \mathbb{R}^{D_y}—
qˉ\bar{q}aggregate posterior, the average of the training trajectories’ posteriors——
Iq[n;z0]I_q[n; \vect{z}_0]mutual information between the index of a training trajectory and its code under the encoderR≥0\mathbb{R}_{\ge 0}—
α(t),α0,s\alpha(t), \alpha_0, sangle of a toy spiral, its start angle and its direction of turn (±1\pm 1)R,[0,2π),{−1,1}\mathbb{R}, [0, 2\pi), \{-1, 1\}—
y,y,Dyy, \vect{y}, D_ycontext of a conditional flow (a one-hot label, a covariate, or the observation y=Hx+ε\vect{y} = \mat{H} \vect{x} + \gvect{\varepsilon} of an inverse problem) and its dimension; the flow learns px(x∣y)p_x(\vect{x} \mid \vect{y})RDy,N\mathbb{R}^{D_y}, \mathbb{N}condition, cond_dim, context, observation
β(y),γ(y)\gvect{\beta}(\vect{y}), \gvect{\gamma}(\vect{y})shift and positive scale that a context sets by FiLM, as in Conditioner’s γ(y)⊙g(x)+β(y)\gvect{\gamma}(\vect{y}) \odot g(\vect{x}) + \gvect{\beta}(\vect{y}); for a conditional diagonal Gaussian base, its mean and standard deviationsRDx,R>0Dx\mathbb{R}^{D_x}, \mathbb{R}^{D_x}_{>0}modulation(condition)
ggin Part 7, the inner bijection that Conditioner wraps between FiLM steps on its input and its output——
z~\tilde{\vect{z}}the latent standardised by a conditional base, (f(x;y)−β(y))⊘γ(y)(f(\vect{x}; \vect{y}) - \gvect{\beta}(\vect{y})) \oslash \gvect{\gamma}(\vect{y})RDx\mathbb{R}^{D_x}latent
w\vect{w}standard-normal noise that generates a toy conditional familyRDx\mathbb{R}^{D_x}—
pd(xd∣y)p_d(x_d \mid y)conditional marginal density of coordinate dd, the factor an elementwise conditional flow learns——
χ22,Fχ22\chi^2_2, F_{\chi^2_2}chi-square distribution with two degrees of freedom, the law of ∥z∥2\lVert \vect{z} \rVert^2 for z∼N(0,I2)\vect{z} \sim \mathcal{N}(\vect{0}, \mat{I}_2), and its CDF 1−e−s/21 - e^{-s/2}——
u~\tilde{u}probability integral transform of ∥z∥2\lVert \vect{z} \rVert^2, uniform on [0,1][0, 1] for a calibrated two-dimensional flow[0,1][0, 1]pit
H\mat{H}linear observation operator of an inverse problem (Householder’s H(u)\mat{H}(\vect{u}) always carries its argument)RDy×Dx\mathbb{R}^{D_y \times D_x}observation_operator
p(x∣y)p(\vect{x} \mid \vect{y})exact posterior of the state given an observation——
qθ(x∣y)q_\theta(\vect{x} \mid \vect{y})amortised posterior, a conditional flow trained on simulated pairs (x,y)(\vect{x}, \vect{y})——
μx∣y,Σx∣y\gvect{\mu}_{x \mid y}, \gmat{\Sigma}_{x \mid y}mean and covariance of the Gaussian posterior of a linear-Gaussian inverse problemRDx,RDx×Dx\mathbb{R}^{D_x}, \mathbb{R}^{D_x \times D_x}posterior_mean, posterior_cov
H[x∣y]H[\vect{x} \mid \vect{y}]conditional entropy of the state given the observation, the floor of the conditional NLLR\mathbb{R}—
Δ\Deltaamortisation gap, Ep(y)KL[p(x∣y)∥qθ(x∣y)]\mathbb{E}_{p(\vect{y})} \mathrm{KL}[p(\vect{x} \mid \vect{y}) \Vert q_\theta(\vect{x} \mid \vect{y})]R≥0\mathbb{R}_{\ge 0}—
a(x)a(\vect{x})acceptance probability of the rejection sampler, the likelihood scaled to a maximum of 1[0,1][0, 1]—

Change of variables from scratch

LabelEquationDerived in
eq-cov-1dpx(x)=pz(f(x))∣f′(x)∣p_x(x) = p_z(f(x)) \vert f'(x) \vert1. The 1-D formula, (1)
eq-cov-jacobian[Jf(x)]ij=∂fi(x)/∂xj[\mat{J}_f(\vect{x})]_{ij} = \partial f_i(\vect{x}) / \partial x_j2. The DxD_x-dimensional formula, (2)
eq-cov-ndpx(x)=pz(f(x))∣det⁡Jf(x)∣p_x(\vect{x}) = p_z(f(\vect{x})) \vert \det \mat{J}_f(\vect{x}) \vert2. The DxD_x-dimensional formula, (3)
eq-cov-loglog⁡px(x)=log⁡pz(f(x))+log⁡∣det⁡Jf(x)∣\log p_x(\vect{x}) = \log p_z(f(\vect{x})) + \log \vert \det \mat{J}_f(\vect{x}) \vert3. Always work in log space, (4)
eq-cov-tanhf(x)=Mtanh⁡(0.7x)+0.5xf(\vect{x}) = \mat{M} \tanh(0.7 \vect{x}) + 0.5 \vect{x}3. Always work in log space, (5)

Composition and the additive log-determinant

LabelEquationDerived in
eq-comp-mapf=fK∘fK−1∘…∘f1f = f_K \circ f_{K-1} \circ \ldots \circ f_11. The composition rule, (1)
eq-comp-statexk=fk(xk−1)\vect{x}_k = f_k(\vect{x}_{k-1})1. The composition rule, (2)
eq-comp-jacobianJf(x)=JfK(xK−1)JfK−1(xK−2)…Jf1(x0)\mat{J}_f(\vect{x}) = \mat{J}_{f_K}(\vect{x}_{K-1}) \mat{J}_{f_{K-1}}(\vect{x}_{K-2}) \ldots \mat{J}_{f_1}(\vect{x}_0)1. The composition rule, (3)
eq-comp-logdetlog⁡∣det⁡Jf(x)∣=∑k=1Klog⁡∣det⁡Jfk(xk−1)∣\log \vert \det \mat{J}_f(\vect{x}) \vert = \sum_{k=1}^{K} \log \vert \det \mat{J}_{f_k}(\vect{x}_{k-1}) \vert1. The composition rule, (4)
eq-comp-logplog⁡px(x)=log⁡pz(f(x))+∑k=1Klog⁡∣det⁡Jfk(xk−1)∣\log p_x(\vect{x}) = \log p_z(f(\vect{x})) + \sum_{k=1}^{K} \log \vert \det \mat{J}_{f_k}(\vect{x}_{k-1}) \vert4. The log-density of a deep flow, (5)

Forward vs inverse

LabelEquationDerived in
eq-dir-samplex=f−1(z), with z∼N(0,I)\vect{x} = f^{-1}(\vect{z}), \text{ with } \vect{z} \sim \mathcal{N}(\vect{0}, \mat{I})1. A flow runs both ways, (1)
eq-dir-cdfF(x)=∑m=1MwmΦ((x−μm)/σm)F(x) = \sum_{m=1}^{M} w_m \Phi((x - \mu_m) / \sigma_m)2. Analytic forward, iterative inverse, (2)
eq-dir-marginalz=Φ−1(F(x))z = \Phi^{-1}(F(x))2. Analytic forward, iterative inverse, (3)
eq-dir-rootF(x)−τ=0F(x) - \tau = 02. Analytic forward, iterative inverse, (4)
eq-dir-bisection∣x(n)−x⋆∣≤(b−a)/2n+1\vert x^{(n)} - x^\star \vert \le (b - a) / 2^{n+1}2. Analytic forward, iterative inverse, (5)

Why a standard Gaussian?

LabelEquationDerived in
eq-gauss-maxentN(μx,Σx)=argmaxp∈P(μx,Σx)H[p]\mathcal{N}(\gvect{\mu}_x, \gmat{\Sigma}_x) = \mathrm{argmax}_{p \in \mathcal{P}(\gvect{\mu}_x, \gmat{\Sigma}_x)} \mathbb{H}[p]1. Maximum entropy at a fixed covariance, (1)
eq-gauss-entropyH[N(μx,Σx)]=12log⁡det⁡(2πeΣx)\mathbb{H}[\mathcal{N}(\gvect{\mu}_x, \gmat{\Sigma}_x)] = \frac{1}{2} \log \det(2 \pi e \gmat{\Sigma}_x)1. Maximum entropy at a fixed covariance, (2)
eq-gauss-negentropyNeg[p]=H[N(μx,Σx)]−H[p]\mathrm{Neg}[p] = \mathbb{H}[\mathcal{N}(\gvect{\mu}_x, \gmat{\Sigma}_x)] - \mathbb{H}[p]1. Maximum entropy at a fixed covariance, (3)
eq-gauss-factoriseN(z;0,I)=∏d=1DxN(zd;0,1)\mathcal{N}(\vect{z}; \vect{0}, \mat{I}) = \prod_{d=1}^{D_x} \mathcal{N}(z_d; 0, 1)2. Separability, (4)
eq-gauss-tcTC[pz]=∑d=1DxH[pzd]−H[pz]\mathrm{TC}[p_z] = \sum_{d=1}^{D_x} \mathbb{H}[p_{z_d}] - \mathbb{H}[p_z]2. Separability, (5)
eq-gauss-logplog⁡N(z;0,I)=−Dx2log⁡(2π)−12∥z∥22\log \mathcal{N}(\vect{z}; \vect{0}, \mat{I}) = -\frac{D_x}{2} \log(2 \pi) - \frac{1}{2} \Vert \vect{z} \Vert_2^23. Cheap primitives, (6)
eq-gauss-score∇zlog⁡N(z;0,I)=−z\nabla_{\vect{z}} \log \mathcal{N}(\vect{z}; \vect{0}, \mat{I}) = -\vect{z}3. Cheap primitives, (7)

Density destructors

LabelEquationDerived in
eq-destr-defx∼px  ⟹  f(x)∼N(0,I)\vect{x} \sim p_x \implies f(\vect{x}) \sim \mathcal{N}(\vect{0}, \mat{I})1. What is a density destructor?, (1)
eq-destr-marginalg(x)d=Φ−1(Fd(xd))g(\vect{x})_d = \Phi^{-1}(F_d(x_d))2. The classic recipe: a nonlinearity and a rotation, (2)
eq-destr-layerfk(x)=Qkgk(x)f_k(\vect{x}) = \mat{Q}_k g_k(\vect{x})2. The classic recipe: a nonlinearity and a rotation, (3)
eq-destr-samplex=f−1(z) with z∼N(0,I)\vect{x} = f^{-1}(\vect{z}) \text{ with } \vect{z} \sim \mathcal{N}(\vect{0}, \mat{I})4. Run it backward to generate, (4)

Numerical mechanics of bijectors

LabelEquationDerived in
eq-num-clampz=Φ−1(clip(F(x),ε,1−ε))z = \Phi^{-1}(\mathrm{clip}(F(x), \varepsilon, 1 - \varepsilon))2. Two guards against a saturated CDF, (1)
eq-num-ceiling∣z∣≤Φ−1(1−ε)\vert z \vert \le \Phi^{-1}(1 - \varepsilon)2. Two guards against a saturated CDF, (2)
eq-num-logprobitlog⁡Φ(z)=log⁡F(x)\log \Phi(z) = \log F(x)2. Two guards against a saturated CDF, (3)
eq-num-roundtripmax⁡n∥f−1(f(xn))−xn∥∞<δ\max_{n} \Vert f^{-1}(f(\vect{x}_n)) - \vect{x}_n \Vert_\infty < \delta4. The round-trip test, (4)

Gaussianity diagnostics

LabelEquationDerived in
eq-diag-skewγ1,d=Epzd[(zd−μd)3]/σd3\gamma_{1,d} = \mathbb{E}_{p_{z_d}}[(z_d - \mu_d)^3] / \sigma_d^32. Marginal diagnostics: QQ-plots and moments, (1)
eq-diag-kurtosisγ2,d=Epzd[(zd−μd)4]/σd4−3\gamma_{2,d} = \mathbb{E}_{p_{z_d}}[(z_d - \mu_d)^4] / \sigma_d^4 - 32. Marginal diagnostics: QQ-plots and moments, (2)
eq-diag-klKL[pz∥N(0,I)]=TC[pz]+∑d=1DxKL[pzd∥N(0,1)]\mathrm{KL}[p_z \Vert \mathcal{N}(\vect{0}, \mat{I})] = \mathrm{TC}[p_z] + \sum_{d=1}^{D_x} \mathrm{KL}[p_{z_d} \Vert \mathcal{N}(0, 1)]3. Negentropy and total correlation, (3)
eq-diag-energyED[pz]=2E∥z−g∥2−E∥z−z′∥2−E∥g−g′∥2\mathrm{ED}[p_z] = 2 \mathbb{E} \Vert \vect{z} - \vect{g} \Vert_2 - \mathbb{E} \Vert \vect{z} - \vect{z}' \Vert_2 - \mathbb{E} \Vert \vect{g} - \vect{g}' \Vert_24. A joint test: the energy distance, (4)

ECDF and histograms

LabelEquationDerived in
eq-ecdf-pitx∼px  ⟹  τ=F(x)∼U(0,1)x \sim p_x \implies \tau = F(x) \sim \mathcal{U}(0, 1)1. The probability integral transform, (1)
eq-ecdf-ecdfF^N(x)=1N∑n=1N1[xn≤x]\hat{F}_N(x) = \frac{1}{N} \sum_{n=1}^{N} \mathbf{1}[x_n \le x]2. The empirical CDF and the DKW rate, (2)
eq-ecdf-dkwPr⁡(sup⁡x∣F^N(x)−F(x)∣>λ)≤2exp⁡(−2Nλ2)\Pr(\sup_x \vert \hat{F}_N(x) - F(x) \vert > \lambda) \le 2 \exp(-2 N \lambda^2)2. The empirical CDF and the DKW rate, (3)
eq-ecdf-derivativeT′(x)=px(x)/N(T(x);0,1)T'(x) = p_x(x) / \mathcal{N}(T(x); 0, 1)5. The log-determinant of a marginal map, (4)
eq-ecdf-marginal-logdetlog⁡∣T′(x)∣=log⁡px(x)−log⁡N(z;0,1)\log \vert T'(x) \vert = \log p_x(x) - \log \mathcal{N}(z; 0, 1)5. The log-determinant of a marginal map, (5)
eq-ecdf-histogramp^x(x)=Nl/(Nh), for x in bin l\hat{p}_x(x) = N_l / (N h), \text{ for } x \text{ in bin } l5. The log-determinant of a marginal map, (6)

KDE and Gaussian-mixture CDFs

LabelEquationDerived in
eq-smooth-kdep^h(x)=1N∑n=1NN(x;xn,h2)\hat{p}_h(x) = \frac{1}{N} \sum_{n=1}^{N} \mathcal{N}(x; x_n, h^2)1. A KDE-based CDF, (1)
eq-smooth-mixturepx(x)=∑m=1MwmN(x;μm,σm2)p_x(x) = \sum_{m=1}^{M} w_m \mathcal{N}(x; \mu_m, \sigma_m^2)2. The Gaussian-mixture CDF, (2)
eq-smooth-bicBIC(M)=(3M−1)log⁡N−2∑n=1Nlog⁡px(xn)\mathrm{BIC}(M) = (3M - 1) \log N - 2 \sum_{n=1}^{N} \log p_x(x_n)3. Choosing the knob: bandwidth and components, (3)

Monotone-spline CDFs

LabelEquationDerived in
eq-spline-xiξ=(x−xl)/(xl+1−xl)\xi = (x - x_l) / (x_{l+1} - x_l)3. The rational-quadratic spline, (1)
eq-spline-rqsT(x)=zl+(zl+1−zl)slξ2+ηlξ(1−ξ)sl+ωlξ(1−ξ)T(x) = z_l + (z_{l+1} - z_l) \frac{s_l \xi^2 + \eta_l \xi (1 - \xi)}{s_l + \omega_l \xi (1 - \xi)}3. The rational-quadratic spline, (2)
eq-spline-quadraticq2ξ2+q1ξ+q0=0q_2 \xi^2 + q_1 \xi + q_0 = 03. The rational-quadratic spline, (3)
eq-spline-inverseξ=2q0−q1−q12−4q2q0\xi = \frac{2 q_0}{-q_1 - \sqrt{q_1^2 - 4 q_2 q_0}}3. The rational-quadratic spline, (4)
eq-spline-derivT′(x)=sl2(ηl+1ξ2+2slξ(1−ξ)+ηl(1−ξ)2)(sl+ωlξ(1−ξ))2T'(x) = \frac{s_l^2 (\eta_{l+1} \xi^2 + 2 s_l \xi (1 - \xi) + \eta_l (1 - \xi)^2)}{(s_l + \omega_l \xi (1 - \xi))^2}4. The log-determinant in closed form, (5)

Mixture CDF as a learnable bijection

LabelEquationDerived in
eq-learn-nllL(θ)=−1N∑n=1Nlog⁡px(xn;θ)\mathcal{L}(\theta) = -\frac{1}{N} \sum_{n=1}^{N} \log p_x(x_n; \theta)1. The maximum-likelihood objective, (1)
eq-learn-paramwm=exp⁡(αm)/∑j=1Mexp⁡(αj), and σm=0.005+log⁡(1+exp⁡(ρm))w_m = \exp(\alpha_m) / \sum_{j=1}^{M} \exp(\alpha_j), \text{ and } \sigma_m = 0.005 + \log(1 + \exp(\rho_m))2. Unconstrained parameters, (2)

Inversion strategies

LabelEquationDerived in
eq-inv-newtonx(n+1)=x(n)−(F(x(n))−τ)/F′(x(n))x^{(n+1)} = x^{(n)} - (F(x^{(n)}) - \tau) / F'(x^{(n)})1. Bisection against Newton, (1)
eq-inv-quadratic∣x(n+1)−x⋆∣≤C∣x(n)−x⋆∣2\vert x^{(n+1)} - x^\star \vert \le C \vert x^{(n)} - x^\star \vert^21. Bisection against Newton, (2)
eq-inv-safeguardx(n+1)={x~(n+1)if an<x~(n+1)<bn(an+bn)/2otherwisex^{(n+1)} = \begin{cases} \tilde{x}^{(n+1)} & \text{if } a_n < \tilde{x}^{(n+1)} < b_n \\ (a_n + b_n) / 2 & \text{otherwise} \end{cases}2. The safeguarded hybrid, (3)
eq-inv-dtau∂x⋆/∂τ=1/F′(x⋆)\partial x^\star / \partial \tau = 1 / F'(x^\star)3. Differentiating the inverse, (4)
eq-inv-dtheta∂x⋆/∂θ=−∂θF(x⋆;θ)/F′(x⋆)\partial x^\star / \partial \theta = -\partial_\theta F(x^\star; \theta) / F'(x^\star)3. Differentiating the inverse, (5)
eq-inv-onestepx^=sg(x⋆)−(F(sg(x⋆))−τ)/F′(sg(x⋆))\hat{x} = \mathrm{sg}(x^\star) - (F(\mathrm{sg}(x^\star)) - \tau) / F'(\mathrm{sg}(x^\star))3. Differentiating the inverse, (6)

The rotation zoo

LabelEquationDerived in
eq-rot-mapz=Qx\vect{z} = \mat{Q} \vect{x}1. A rotation is free, (1)
eq-rot-logdetlog⁡∣det⁡Jf(x)∣=log⁡∣det⁡Q∣=0\log \vert \det \mat{J}_f(\vect{x}) \vert = \log \vert \det \mat{Q} \vert = 01. A rotation is free, (2)
eq-rot-pcaΣx=VΛV⊤\gmat{\Sigma}_x = \mat{V} \gmat{\Lambda} \mat{V}^\top1. A rotation is free, (3)
eq-rot-whiten-logdetlog⁡∣det⁡Jf(x)∣=−12log⁡det⁡Λ=−12log⁡det⁡Σx\log \vert \det \mat{J}_f(\vect{x}) \vert = -\frac{1}{2} \log \det \gmat{\Lambda} = -\frac{1}{2} \log \det \gmat{\Sigma}_x1. A rotation is free, (4)
eq-rot-haarG=QR\mat{G} = \mat{Q} \mat{R}2. The rotation zoo, (5)
eq-rot-tc-shiftTC[pQx]=∑d=1DxH[p(Qx)d]−H[px]\mathrm{TC}[p_{\mat{Q}\vect{x}}] = \sum_{d=1}^{D_x} \mathbb{H}[p_{(\mat{Q}\vect{x})_d}] - \mathbb{H}[p_x]2. The rotation zoo, (6)
eq-rot-tc-invariantTC[pg(x)]=TC[px]\mathrm{TC}[p_{g(\vect{x})}] = \mathrm{TC}[p_x]5. Why the rotation is what removes dependence, (7)
eq-rot-kl-invariantKL[pQx∥N(0,I)]=KL[px∥N(0,I)]\mathrm{KL}[p_{\mat{Q}\vect{x}} \Vert \mathcal{N}(\vect{0}, \mat{I})] = \mathrm{KL}[p_x \Vert \mathcal{N}(\vect{0}, \mat{I})]5. Why the rotation is what removes dependence, (8)

Householder and trainable orthogonals

LabelEquationDerived in
eq-house-reflectH(u)=I−2uu⊤u⊤u\mat{H}(\vect{u}) = \mat{I} - 2 \frac{\vect{u} \vect{u}^\top}{\vect{u}^\top \vect{u}}1. The Householder reflection, (1)
eq-house-productQ=H(uK)H(uK−1)…H(u1)\mat{Q} = \mat{H}(\vect{u}_K) \mat{H}(\vect{u}_{K-1}) \ldots \mat{H}(\vect{u}_1)2. Products of reflections, (2)
eq-house-detdet⁡Q=(−1)K\det \mat{Q} = (-1)^K2. Products of reflections, (3)
eq-orth-fit∥Q(θ)−Q⋆∥F2=2Dx−2tr(Q(θ)⊤Q⋆)\Vert \mat{Q}(\theta) - \mat{Q}_\star \Vert_F^2 = 2 D_x - 2 \mathrm{tr}(\mat{Q}(\theta)^\top \mat{Q}_\star)3. Training a rotation, (4)
eq-cayley-mapQ=(I−S)(I+S)−1\mat{Q} = (\mat{I} - \mat{S}) (\mat{I} + \mat{S})^{-1}4. The Cayley map and the matrix exponential, (5)
eq-cayley-expmQ=exp⁡(S)\mat{Q} = \exp(\mat{S})4. The Cayley map and the matrix exponential, (6)
eq-orth-parity∥Q−Q⋆∥F2≥4\Vert \mat{Q} - \mat{Q}_\star \Vert_F^2 \ge 45. What each can reach, (7)

Fixed rotations and warm starts

LabelEquationDerived in
eq-fixed-decorrelateQΣxQ⊤=Λ\mat{Q} \gmat{\Sigma}_x \mat{Q}^\top = \gmat{\Lambda}1. The PCA frame as a fixed rotation, (1)
eq-fixed-bookedL0(A)=−1N∑n=1Nlog⁡N(Axn;0,I)\mathcal{L}_0(\mat{A}) = -\frac{1}{N} \sum_{n=1}^{N} \log \mathcal{N}(\mat{A} \vect{x}_n; \vect{0}, \mat{I})2. Why the frame is frozen, (2)
eq-fixed-trueL(A)=L0(A)−log⁡∣det⁡A∣\mathcal{L}(\mat{A}) = \mathcal{L}_0(\mat{A}) - \log \vert \det \mat{A} \vert2. Why the frame is frozen, (3)
eq-warm-decomposeH(uDx)…H(u1)Q=I\mat{H}(\vect{u}_{D_x}) \ldots \mat{H}(\vect{u}_1) \mat{Q} = \mat{I}3. Starting a trainable rotation at a given frame, (4)
eq-warm-hadamardL⋆(Q)=12∑d=1Dxlog⁡(2πe(QΣxQ⊤)dd)≥12log⁡det⁡(2πeΣx)\mathcal{L}^\star(\mat{Q}) = \frac{1}{2} \sum_{d=1}^{D_x} \log(2 \pi e (\mat{Q} \gmat{\Sigma}_x \mat{Q}^\top)_{dd}) \ge \frac{1}{2} \log \det(2 \pi e \gmat{\Sigma}_x)4. Cold and warm starts under maximum likelihood, (5)

The 1×1 convolution and ActNorm

LabelEquationDerived in
eq-lu-mapzp=Axp\vect{z}_p = \mat{A} \vect{x}_p1. The invertible 1×1 convolution, (1)
eq-lu-positionslog⁡∣det⁡Jf(x)∣=Plog⁡∣det⁡A∣\log \vert \det \mat{J}_f(\vect{x}) \vert = P \log \vert \det \mat{A} \vert1. The invertible 1×1 convolution, (2)
eq-lu-factorA=LU\mat{A} = \mat{L} \mat{U}1. The invertible 1×1 convolution, (3)
eq-lu-logdetlog⁡∣det⁡A∣=∑d=1Dxlog⁡Udd\log \vert \det \mat{A} \vert = \sum_{d=1}^{D_x} \log U_{dd}1. The invertible 1×1 convolution, (4)
eq-actnorm-mapz=diag(s)−1(x−b)\vect{z} = \mathrm{diag}(\vect{s})^{-1} (\vect{x} - \vect{b})4. ActNorm, (5)
eq-actnorm-logdetlog⁡∣det⁡Jf(x)∣=−∑d=1Dxlog⁡sd\log \vert \det \mat{J}_f(\vect{x}) \vert = -\sum_{d=1}^{D_x} \log s_d4. ActNorm, (6)
eq-actnorm-initsd2=1N∑n=1N(xn,d−bd)2s_d^2 = \frac{1}{N} \sum_{n=1}^{N} (x_{n,d} - b_d)^24. ActNorm, (7)

The canonical RBIG loop

LabelEquationDerived in
eq-rbig-midpointF^N(x(n))=n−1/2N\hat{F}_N(x_{(n)}) = \frac{n - 1/2}{N}1. One RBIG layer, (1)
eq-rbig-marginalgk(x)d=Φ−1(F^k,d(xd))g_k(\vect{x})_d = \Phi^{-1}(\hat{F}_{k,d}(x_d))1. One RBIG layer, (2)
eq-rbig-ks-maxKSmax⁡=max⁡jsup⁡t∣F^N,j(t)−Φ(t)∣\mathrm{KS}_{\max} = \max_{j} \sup_{t} \vert \hat{F}_{N,j}(t) - \Phi(t) \vert2. The loop, (3)
eq-rbig-inversefk−1(z)=gk−1(Qk⊤z)f_k^{-1}(\vect{z}) = g_k^{-1}(\mat{Q}_k^\top \vect{z})3. Running the stack backwards, (4)

Convergence and stopping

LabelEquationDerived in
eq-rbig-bananax=(w1,w2+β(w12−1))\vect{x} = (w_1, w_2 + \beta (w_1^2 - 1))1. A dataset with a known answer, (1)
eq-rbig-banana-klKL[px∥N(0,I)]=β2\mathrm{KL}[p_x \Vert \mathcal{N}(\vect{0}, \mat{I})] = \beta^21. A dataset with a known answer, (2)
eq-rbig-reductionΔk=∑d=1DxKL[pxk−1,d∥N(0,1)]\Delta_k = \sum_{d=1}^{D_x} \mathrm{KL}[p_{x_{k-1,d}} \Vert \mathcal{N}(0, 1)]2. What one layer removes, (3)
eq-rbig-telescopeKL[px∥N(0,I)]=∑k=1KΔk+KL[pxK∥N(0,I)]\mathrm{KL}[p_x \Vert \mathcal{N}(\vect{0}, \mat{I})] = \sum_{k=1}^{K} \Delta_k + \mathrm{KL}[p_{\vect{x}_K} \Vert \mathcal{N}(\vect{0}, \mat{I})]2. What one layer removes, (4)
eq-rbig-tc-wayTC[px]=∑k=2KΔk+KL[pxK∥N(0,I)]\mathrm{TC}[p_x] = \sum_{k=2}^{K} \Delta_k + \mathrm{KL}[p_{\vect{x}_K} \Vert \mathcal{N}(\vect{0}, \mat{I})]2. What one layer removes, (5)

Boundaries and support

LabelEquationDerived in
eq-rbig-pareto-tailF^(x)=us+(1−us)G(x−xs)\hat{F}(x) = u_{\mathrm{s}} + (1 - u_{\mathrm{s}}) G(x - x_{\mathrm{s}})5. Generating beyond the range, (1)
eq-rbig-dequantlog⁡pc(c)≥Eu∼U(0,1)[log⁡px(c+u)]\log p_c(c) \ge \mathbb{E}_{u \sim \mathcal{U}(0, 1)}[\log p_x(c + u)]6. Discrete data, (2)

NLL training of a Gaussianization flow

LabelEquationDerived in
eq-param-nll-splitL(θ)=1N∑n=1N(12∥fθ(xn)∥2+Dx2log⁡2π)−1N∑n=1Nlog⁡∣det⁡Jfθ(xn)∣\mathcal{L}(\theta) = \frac{1}{N} \sum_{n=1}^{N} \left( \frac{1}{2} \Vert f_\theta(\vect{x}_n) \Vert^2 + \frac{D_x}{2} \log 2\pi \right) - \frac{1}{N} \sum_{n=1}^{N} \log \vert \det \mat{J}_{f_\theta}(\vect{x}_n) \vert1. The objective, term by term, (1)
eq-param-scaleL(κ)=κ22N∑n=1N∥xn∥2+Dx2log⁡2π−Dxlog⁡κ\mathcal{L}(\kappa) = \frac{\kappa^2}{2N} \sum_{n=1}^{N} \Vert \vect{x}_n \Vert^2 + \frac{D_x}{2} \log 2\pi - D_x \log \kappa1. The objective, term by term, (2)
eq-param-affine-baselog⁡N(z;μz,diag(σz2))=log⁡N((z−μz)/σz;0,I)−∑d=1Dxlog⁡σz,d\log \mathcal{N}(\vect{z}; \gvect{\mu}_z, \mathrm{diag}(\gvect{\sigma}_z^2)) = \log \mathcal{N}((\vect{z} - \gvect{\mu}_z) / \gvect{\sigma}_z; \vect{0}, \mat{I}) - \sum_{d=1}^{D_x} \log \sigma_{z,d}2. Training with pipekit-train, (3)

RBIG as a warm start

LabelEquationDerived in
eq-param-warm-orderfcold=(QK∘gK)∘…∘(Q1∘g1),fwarm=(gK∘QK)∘…∘(g1∘Q1)\begin{aligned} f_{\mathrm{cold}} &= (\mat{Q}_K \circ g_K) \circ \ldots \circ (\mat{Q}_1 \circ g_1), \\ f_{\mathrm{warm}} &= (g_K \circ \mat{Q}_K) \circ \ldots \circ (g_1 \circ \mat{Q}_1) \end{aligned}1. What the warm start hands over, (1)

The coupling pattern

LabelEquationDerived in
eq-cpl-splitzA=xA,θ=cϕ(xA),zB=Tθ(xB)\begin{aligned} \vect{z}_A &= \vect{x}_A, \\ \theta &= c_\phi(\vect{x}_A), \\ \vect{z}_B &= T_\theta(\vect{x}_B) \end{aligned}The coupling layer at a glance, (1)
eq-cpl-affinezB=σB(xA)⊙xB+μB(xA)\vect{z}_B = \gvect{\sigma}_B(\vect{x}_A) \odot \vect{x}_B + \gvect{\mu}_B(\vect{x}_A)1. A fresh layer is the identity, (2)
eq-cpl-jacobianJf(x)=(I0∂zB/∂xAdiag(σB(xA)))\mat{J}_f(\vect{x}) = \begin{pmatrix} \mat{I} & \mat{0} \\ \partial \vect{z}_B / \partial \vect{x}_A & \mathrm{diag}(\gvect{\sigma}_B(\vect{x}_A)) \end{pmatrix}2. The triangular Jacobian, (3)
eq-cpl-logdetlog⁡∣det⁡Jf(x)∣=∑d∈Blog⁡σB,d(xA)\log \vert \det \mat{J}_f(\vect{x}) \vert = \sum_{d \in B} \log \sigma_{B,d}(\vect{x}_A)2. The triangular Jacobian, (4)
eq-cpl-inversexA=zA,θ=cϕ(zA),xB=Tθ−1(zB)\begin{aligned} \vect{x}_A &= \vect{z}_A, \\ \theta &= c_\phi(\vect{z}_A), \\ \vect{x}_B &= T_\theta^{-1}(\vect{z}_B) \end{aligned}3. The inverse never inverts the network, (5)

The transformer menu for coupling

LabelEquationDerived in
eq-cpl-menu-sigmoidTθ(x)=r0x+t0+∑m=1Mrmς(kmx+tm)T_\theta(x) = r_0 x + t_0 + \sum_{m=1}^{M} r_m \varsigma(k_m x + t_m)The transformer menu for coupling, (1)

Mask design for coupling flows

LabelEquationDerived in
eq-cpl-mask-fixedf(x)A=(fK∘…∘f1)(x)A=xAf(\vect{x})_A = (f_K \circ \ldots \circ f_1)(\vect{x})_A = \vect{x}_A1. The same mask in every layer, (1)
eq-cpl-mask-alternatef=(Π∘fK)∘…∘(Π∘f1)f = (\gmat{\Pi} \circ f_K) \circ \ldots \circ (\gmat{\Pi} \circ f_1)2. Flipping the coordinates between layers, (2)

Diagonal against coupling flows

LabelEquationDerived in
eq-cpl-diag-jacobianJgk(x)=diag(T1′(x1),…,TDx′(xDx))\mat{J}_{g_k}(\vect{x}) = \mathrm{diag}(T_1'(x_1), \ldots, T_{D_x}'(x_{D_x}))Diagonal against coupling flows, (1)

RBIG warm start for coupling flows

LabelEquationDerived in
eq-cpl-warm-readoutθ=Woutv(xA)+bout\theta = \mat{W}_{\mathrm{out}} \vect{v}(\vect{x}_A) + \vect{b}_{\mathrm{out}}2. The warm start is a marginal map, (1)

Coupling and diagonal equivalence

LabelEquationDerived in
eq-cpl-equiv-constantzA=xA,zB=Tbout(xB)\begin{aligned} \vect{z}_A &= \vect{x}_A, \\ \vect{z}_B &= T_{\vect{b}_{\mathrm{out}}}(\vect{x}_B) \end{aligned}1. Why a zero readout gives a marginal map, (1)

Depth, gradients and residual maps

LabelEquationDerived in
eq-cpl-depth-residualy=x+r(x)y = x + r(x)3. Residual maps, (1)
eq-cpl-depth-fixed-pointx(n+1)=y−r(x(n))x^{(n+1)} = y - r(x^{(n)})3. Residual maps, (2)

FFJORD on two moons

LabelEquationDerived in
eq-cnf-ffjord-odedx(t)dt=vθ(t,x(t)),x(0)=z,x(1)=x\begin{aligned} \frac{\mathrm{d} \vect{x}(t)}{\mathrm{d} t} &= \vect{v}_\theta(t, \vect{x}(t)), \\ \vect{x}(0) &= \vect{z}, \\ \vect{x}(1) &= \vect{x} \end{aligned}The continuous change of variables, (1)
eq-cnf-ffjord-logdetlog⁡∣det⁡∂x(1)∂x(0)∣=∫01tr(Jv(t,x(t)))dt\log \left\vert \det \frac{\partial \vect{x}(1)}{\partial \vect{x}(0)} \right\vert = \int_0^1 \mathrm{tr}(\mat{J}_v(t, \vect{x}(t))) \mathrm{d} tThe continuous change of variables, (2)
eq-cnf-ffjord-instantdlog⁡p(x(t))dt=−tr(Jv(t,x(t)))\frac{\mathrm{d} \log p(\vect{x}(t))}{\mathrm{d} t} = -\mathrm{tr}(\mat{J}_v(t, \vect{x}(t)))The continuous change of variables, (3)
eq-cnf-ffjord-logplog⁡px(x)=log⁡N(z;0,I)−∫01tr(Jv(t,x(t)))dt\log p_x(\vect{x}) = \log \mathcal{N}(\vect{z}; \vect{0}, \mat{I}) - \int_0^1 \mathrm{tr}(\mat{J}_v(t, \vect{x}(t))) \mathrm{d} tThe continuous change of variables, (4)

Hutchinson’s trace estimator

LabelEquationDerived in
eq-cnf-hutch-identitytr(A)=Eϵ[ϵ⊤Aϵ]\mathrm{tr}(\mat{A}) = \mathbb{E}_{\gvect{\epsilon}}[\gvect{\epsilon}^\top \mat{A} \gvect{\epsilon}]The estimator, (1)
eq-cnf-hutch-estimatortr^(A)=1Np∑i=1Npϵi⊤Aϵi\widehat{\mathrm{tr}}(\mat{A}) = \frac{1}{N_p} \sum_{i=1}^{N_p} \gvect{\epsilon}_i^\top \mat{A} \gvect{\epsilon}_iThe estimator, (2)
eq-cnf-hutch-varianceVarRademacher[ϵ⊤Aϵ]=2(∥A∥F2−∑d=1DxAdd2),VarGauss[ϵ⊤Aϵ]=2∥A∥F2\begin{aligned} \mathrm{Var}_{\mathrm{Rademacher}}[\gvect{\epsilon}^\top \mat{A} \gvect{\epsilon}] &= 2 \left( \Vert \mat{A} \Vert_F^2 - \sum_{d=1}^{D_x} A_{dd}^2 \right), \\ \mathrm{Var}_{\mathrm{Gauss}}[\gvect{\epsilon}^\top \mat{A} \gvect{\epsilon}] &= 2 \Vert \mat{A} \Vert_F^2 \end{aligned}2. Rademacher or Gaussian probes, (3)
eq-cnf-hutch-2dϵ⊤Jvϵ=tr(Jv)+ϵ1ϵ2(J12+J21)\gvect{\epsilon}^\top \mat{J}_v \gvect{\epsilon} = \mathrm{tr}(\mat{J}_v) + \epsilon_1 \epsilon_2 (J_{12} + J_{21})5. Fixed probes, (4)

The matrix-exponential flow

LabelEquationDerived in
eq-cnf-expm-mapz=etAx+φ(t)b\vect{z} = e^{t \mat{A}} \vect{x} + \varphi(t) \vect{b}1. The layer, (1)
eq-cnf-expm-logdetlog⁡∣det⁡J(x)∣=log⁡det⁡etA=ttr(A)\log \vert \det \mat{J}(\vect{x}) \vert = \log \det e^{t \mat{A}} = t \mathrm{tr}(\mat{A})2. The log-determinant and the inverse in closed form, (2)
eq-cnf-expm-inversex=e−tA(z−φ(t)b)\vect{x} = e^{-t \mat{A}} (\vect{z} - \varphi(t) \vect{b})2. The log-determinant and the inverse in closed form, (3)
eq-cnf-expm-semigroupesAetA=e(s+t)Ae^{s \mat{A}} e^{t \mat{A}} = e^{(s + t) \mat{A}}3. A flow, but of which ODE?, (4)
eq-cnf-expm-fielddzdt=Az+(φ′(t)I−φ(t)A)b\frac{d\vect{z}}{dt} = \mat{A} \vect{z} + (\varphi'(t) \mat{I} - \varphi(t) \mat{A}) \vect{b}3. A flow, but of which ODE?, (5)
eq-cnf-expm-ceilingmin⁡affineL(θ)=12log⁡det⁡(2πeΣ^x)\min_{\text{affine}} \mathcal{L}(\theta) = \frac{1}{2} \log \det(2 \pi e \hat{\gmat{\Sigma}}_x)4. Trained at t=1t = 1: the ceiling of an affine map, (6)

Latent ODEs and the Gaussian they ask for

LabelEquationDerived in
eq-cnf-latent-modelz0∼N(0,I),dzdt=vθ(t,z),xi∼N(decθ(z(ti)),σobs2I)\begin{aligned} \vect{z}_0 &\sim \mathcal{N}(\vect{0}, \mat{I}), \\ \frac{d\vect{z}}{dt} &= \vect{v}_\theta(t, \vect{z}), \\ \vect{x}_i &\sim \mathcal{N}(\mathrm{dec}_\theta(\vect{z}(t_i)), \sigma_{\mathrm{obs}}^2 \mat{I}) \end{aligned}2. The model and its lower bound, (1)
eq-cnf-latent-elbolog⁡pθ(X)≥Eqϕ(z0∣X)[∑i=1Nolog⁡N(xi;decθ(z(ti)),σobs2I)]−KL[qϕ(z0∣X)∥N(0,I)]\log p_\theta(\mathcal{X}) \ge \mathbb{E}_{q_\phi(\vect{z}_0 \mid \mathcal{X})} \left[ \sum_{i=1}^{N_o} \log \mathcal{N}(\vect{x}_i; \mathrm{dec}_\theta(\vect{z}(t_i)), \sigma_{\mathrm{obs}}^2 \mat{I}) \right] - \mathrm{KL}[q_\phi(\vect{z}_0 \mid \mathcal{X}) \Vert \mathcal{N}(\vect{0}, \mat{I})]2. The model and its lower bound, (2)
eq-cnf-latent-klKL[qϕ(z0∣X)∥N(0,I)]=12∑k=1Dz(σϕ,k2+μϕ,k2−1−log⁡σϕ,k2)\mathrm{KL}[q_\phi(\vect{z}_0 \mid \mathcal{X}) \Vert \mathcal{N}(\vect{0}, \mat{I})] = \frac{1}{2} \sum_{k=1}^{D_z} (\sigma_{\phi,k}^2 + \mu_{\phi,k}^2 - 1 - \log \sigma_{\phi,k}^2)2. The model and its lower bound, (3)
eq-cnf-latent-aggregateqˉ(z0)=1Nt∑n=1Ntqϕ(z0∣Xn)\bar{q}(\vect{z}_0) = \frac{1}{N_t} \sum_{n=1}^{N_t} q_\phi(\vect{z}_0 \mid \mathcal{X}_n)4. How far the codes are from the prior, (4)
eq-cnf-latent-split1Nt∑n=1NtKL[qϕ(z0∣Xn)∥N(0,I)]=Iq[n;z0]+KL[qˉ∥N(0,I)]\frac{1}{N_t} \sum_{n=1}^{N_t} \mathrm{KL}[q_\phi(\vect{z}_0 \mid \mathcal{X}_n) \Vert \mathcal{N}(\vect{0}, \mat{I})] = I_q[n; \vect{z}_0] + \mathrm{KL}[\bar{q} \Vert \mathcal{N}(\vect{0}, \mat{I})]4. How far the codes are from the prior, (5)
eq-cnf-latent-gapKL[qˉ∥N(0,I)]≥1Nt∑n=1NtKL[qϕ(z0∣Xn)∥N(0,I)]−log⁡Nt\mathrm{KL}[\bar{q} \Vert \mathcal{N}(\vect{0}, \mat{I})] \ge \frac{1}{N_t} \sum_{n=1}^{N_t} \mathrm{KL}[q_\phi(\vect{z}_0 \mid \mathcal{X}_n) \Vert \mathcal{N}(\vect{0}, \mat{I})] - \log N_t4. How far the codes are from the prior, (6)

Three ways to condition a flow

LabelEquationDerived in
eq-cond-three-covlog⁡p(x∣y)=log⁡pz(f(x;y)∣y)+log⁡∣det⁡Jf(x;y)∣\log p(\vect{x} \mid \vect{y}) = \log p_z(f(\vect{x}; \vect{y}) \mid \vect{y}) + \log \vert \det \mat{J}_f(\vect{x}; \vect{y}) \vert2. Where the context can enter, (1)
eq-cond-three-basepz(z∣y)=N(z;β(y),diag(γ(y))2)p_z(\vect{z} \mid \vect{y}) = \mathcal{N}(\vect{z}; \gvect{\beta}(\vect{y}), \mathrm{diag}(\gvect{\gamma}(\vect{y}))^2)2. Where the context can enter, (2)
eq-cond-three-couplingzB=Tθ(xB),θ=cϕ(xA,y)\begin{aligned} \vect{z}_B &= T_\theta(\vect{x}_B), \\ \theta &= c_\phi(\vect{x}_A, \vect{y}) \end{aligned}2. Where the context can enter, (3)
eq-cond-three-filmh′=γ(y)⊙g(h)+β(y)\vect{h}' = \gvect{\gamma}(\vect{y}) \odot g(\vect{h}) + \gvect{\beta}(\vect{y})2. Where the context can enter, (4)
eq-cond-three-standardisez~=(f(x;y)−β(y))⊘γ(y)\tilde{\vect{z}} = (f(\vect{x}; \vect{y}) - \gvect{\beta}(\vect{y})) \oslash \gvect{\gamma}(\vect{y})4. How Gaussian is each slice?, (5)
eq-cond-three-layersconcatenation:h′=W[h;y]+b,FiLM:h′=γ(y)⊙h+β(y),hypernetwork:h′=W(y)h+b(y)\begin{aligned} \text{concatenation:} & \vect{h}' = \mat{W} [\vect{h}; \vect{y}] + \vect{b}, \\ \text{FiLM:} & \vect{h}' = \gvect{\gamma}(\vect{y}) \odot \vect{h} + \gvect{\beta}(\vect{y}), \\ \text{hypernetwork:} & \vect{h}' = \mat{W}(\vect{y}) \vect{h} + \vect{b}(\vect{y}) \end{aligned}6. The conditioning layers, (6)

Conditional density estimation

LabelEquationDerived in
eq-cond-dens-familyx1=0.8w1,x2=0.6w2+1.5ytanh⁡(1.2w1)\begin{aligned} x_1 &= 0.8 w_1, \\ x_2 &= 0.6 w_2 + 1.5 y \tanh(1.2 w_1) \end{aligned}1. A family that bends with the context, (1)
eq-cond-dens-exactlog⁡px(x∣y)=log⁡N(w1;0,1)+log⁡N(w2;0,1)−log⁡0.8−log⁡0.6\log p_x(\vect{x} \mid y) = \log \mathcal{N}(w_1; 0, 1) + \log \mathcal{N}(w_2; 0, 1) - \log 0.8 - \log 0.61. A family that bends with the context, (2)
eq-cond-dens-covlog⁡px(x∣y)=log⁡N(fθ(x;y);0,I)+log⁡∣det⁡Jfθ(x;y)∣\log p_x(\vect{x} \mid y) = \log \mathcal{N}(f_\theta(\vect{x}; y); \vect{0}, \mat{I}) + \log \lvert \det \mat{J}_{f_\theta}(\vect{x}; y) \rvert2. A conditional coupling flow, (3)
eq-cond-dens-pitu~=Fχ22(∥z∥2)=1−e−∥z∥2/2\tilde{u} = F_{\chi^2_2}(\lVert \vect{z} \rVert^2) = 1 - e^{-\lVert \vect{z} \rVert^2 / 2}5. A calibration test, (4)
eq-cond-dens-marginalpx(x∣y)=∏d=1Dxpd(xd∣y)p_x(\vect{x} \mid y) = \prod_{d=1}^{D_x} p_d(x_d \mid y)6. When elementwise maps are enough, (5)

A conditional flow as an amortised posterior

LabelEquationDerived in
eq-cond-post-forwardy=Hx+ε\vect{y} = \mat{H} \vect{x} + \gvect{\varepsilon}1. An inverse problem and its posterior, (1)
eq-cond-post-bayesp(x∣y)=p(y∣x)p(x)p(y)p(\vect{x} \mid \vect{y}) = \frac{p(\vect{y} \mid \vect{x}) p(\vect{x})}{p(\vect{y})}1. An inverse problem and its posterior, (2)
eq-cond-post-objectiveEp(x,y)[−log⁡qθ(x∣y)]=H[x∣y]+Ep(y)KL[p(x∣y)∥qθ(x∣y)]\mathbb{E}_{p(\vect{x}, \vect{y})}[-\log q_\theta(\vect{x} \mid \vect{y})] = H[\vect{x} \mid \vect{y}] + \mathbb{E}_{p(\vect{y})} \mathrm{KL}[p(\vect{x} \mid \vect{y}) \Vert q_\theta(\vect{x} \mid \vect{y})]1. An inverse problem and its posterior, (3)
eq-cond-post-gaussΣx∣y=(Σx−1+σobs−2H⊤H)−1,μx∣y=Σx∣y(Σx−1μx+σobs−2H⊤y)\begin{aligned} \gmat{\Sigma}_{x \mid y} &= (\gmat{\Sigma}_x^{-1} + \sigma_{\mathrm{obs}}^{-2} \mat{H}^\top \mat{H})^{-1}, \\ \gvect{\mu}_{x \mid y} &= \gmat{\Sigma}_{x \mid y} (\gmat{\Sigma}_x^{-1} \gvect{\mu}_x + \sigma_{\mathrm{obs}}^{-2} \mat{H}^\top \vect{y}) \end{aligned}2. A linear-Gaussian problem, solved exactly, (4)
eq-cond-post-gapΔ=Ep(y)KL[p(x∣y)∥qθ(x∣y)]≈1Nv∑n=1Nv[log⁡p(xn∣yn)−log⁡qθ(xn∣yn)]\Delta = \mathbb{E}_{p(\vect{y})} \mathrm{KL}[p(\vect{x} \mid \vect{y}) \Vert q_\theta(\vect{x} \mid \vect{y})] \approx \frac{1}{N_v} \sum_{n=1}^{N_v} [\log p(\vect{x}_n \mid \vect{y}_n) - \log q_\theta(\vect{x}_n \mid \vect{y}_n)]4. The amortisation gap, (5)
eq-cond-post-accepta(x)=exp⁡(−∥y−Hx∥22σobs2)a(\vect{x}) = \exp \left( -\frac{\Vert \vect{y} - \mat{H} \vect{x} \Vert^2}{2 \sigma_{\mathrm{obs}}^2} \right)5. A posterior with several modes, (6)