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.

Part 6 · Continuous-time Gaussianization

The flows of Parts 4 and 5 are stacks of layers, each with a log-determinant of its own. A continuous flow replaces the stack with an ordinary differential equation: a vector field carries every point from the data to the latent, the map is the solution of the ODE, and the log-determinant is the time integral of the field’s divergence. The field can be any network, so the map is free-form, and the price is an ODE solve for every density and a trace for every step of the solver. This part trains FFJORD on two moons, replaces its exact trace with Hutchinson’s estimator, takes the linear field whose flow is a matrix exponential and has a closed-form log-determinant, and ends with a latent ODE, where the ODE models whole trajectories and the Gaussian is asked of a latent code rather than of the data.

#NotebookWhat you take away
00FFJORD on two moonsa flow that solves an ODE (1); its log-determinant is the time integral of a trace (2), the instantaneous change of variables (3), and it matches the autodiff Jacobian of the solved map to 4e−6; 1,500 steps of pipekit-train (about three minutes) take the held-out NLL from 2.77 to 1.39 nats; the density sums to 0.9999 over a grid, the latent passes a moments and quantile check, and the paths carry the moons apart into a Gaussian without crossing
01Hutchinson’s trace estimatoran unbiased trace from probes (2) whose error falls as 1/Np1/\sqrt{N_p}; Rademacher and Gaussian variances (3) checked by sampling; gaussx’s Hutch++ and XTrace do not help on a matrix with a flat spectrum; on a trained 6-D FFJORD one probe misses the divergence by more than its spread across rows, and rows sharing fixed probes have correlated log-density errors; in 2-D the error is set by one number per key (4); training on FFJORD’s fixed probes fits the probes, not the data (gauss_flows#267); at Dx=512D_x = 512 the exact trace costs about 14 times one probe
02The matrix-exponential flowthe layer etAx+φ(t)be^{t \mat{A}} \vect{x} + \varphi(t) \vect{b} (1) is the identity at t=0t = 0 for any weights; its log-determinant is ttr(A)t \mathrm{tr}(\mat{A}) (2), equal to autodiff to 4×10−164 \times 10^{-16}, and its inverse is the exponential at −t-t (3); a skew-symmetric generator is a rotation; the shift makes it the flow of a time-dependent field (5), so two steps in time differ from one by 0.22; trained at t=1t = 1, one layer and three both stop exactly at the entropy of the fitted Gaussian (6) on a tilted Gaussian (3.0135 nats) and on two moons (2.7341 nats), where the latent keeps excess kurtosis -0.60 and -1.17
03Latent ODEs and the Gaussian they ask fora latent ODE (1) is trained by its evidence lower bound (2), not negative_log_likelihood; trained with pipekit-train in float32 (about 90 s), it reconstructs held-out spirals to an RMSE of 0.17; the mean KL term is 33.0 nats, and splitting it (5) shows the aggregate posterior is at least 27.5 nats from N(0,I)\mathcal{N}(\vect{0}, \mat{I}) (6); the codes sit off-centre and split by direction; prior draws decode to paths that barely turn (median 0.20 rad per unit time against 1.5), while draws from fit_rbig fitted to the codes turn at a median 1.43 with less than half the radius error; fit_rbig needs float32 (gauss_flows#247)

The FFJORD example trains the same flow on two moons and shows its vector field at three times.