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.
| # | Notebook | What you take away |
|---|---|---|
| 00 | FFJORD on two moons | a 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 |
| 01 | Hutchinson’s trace estimator | an unbiased trace from probes (2) whose error falls as ; 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 the exact trace costs about 14 times one probe |
| 02 | The matrix-exponential flow | the layer (1) is the identity at for any weights; its log-determinant is (2), equal to autodiff to , and its inverse is the exponential at (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 , 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 |
| 03 | Latent ODEs and the Gaussian they ask for | a 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 (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.