Part 0 — Foundations
The conceptual bedrock for the whole Gaussianization curriculum. Before fitting
any flow, these seven notebooks build — from scratch in JAX, then confirmed
against the mature rbig and
gauss_flows packages — the small
set of ideas every later method reuses: the change-of-variables formula and its
log-determinant, how those compose, the forward/inverse trade-off, why
is the target, what a density destructor is, the numerics
that keep one stable, and how to certify it converged.
Each notebook follows the same pattern: derive the idea by hand, then show the exact same quantity coming out of the library. That way the packages stop being black boxes — you have seen what every call computes.
Notebooks¶
| # | notebook | master list | what you take away |
|---|---|---|---|
| 00 | Change of variables | 0.1 | ; the library’s log_det is this Jacobian |
| 01 | Composition & log-det | 0.2 | stacking maps ⇒ log-dets add; rotations are free |
| 02 | Forward vs. inverse | 0.3 | density vs. sampling cost; differentiating a root-find by the adjoint (optimistix) |
| 03 | Why ? | 0.4 | max-entropy, separability (TC), trivial score |
| 04 | Density destructors | 0.5–0.6 | Gaussianization = iterated whitening + nonlinearity (RBIG) |
| 05 | Numerical mechanics | 0.7–0.9 | jitter/clamp, float64 log-dets, the round-trip CI test |
| 06 | Gaussianity diagnostics | 0.10–0.12 | QQ/moments, negentropy, energy-distance normality test |
The numbering and scope follow the Part 0 rows of the project
TUTORIAL_MASTER_LIST.md.
Packages¶
These notebooks use two of the author’s libraries as the source of truth:
rbig— mature NumPy/SciPy Rotation-Based Iterative Gaussianization with a full information-theory suite (AnnealedRBIG,negentropy,total_correlation, marginal/rotation bijectors).gauss_flows— the modern JAX /flowjaxsuccessor: trainable Gaussianization flows, bijectors withtransform_and_log_det, andoptimistix-based inverses.
Running¶
The foundations notebooks need rbig + gauss_flows + a Jupyter stack, which
live outside the conda-forge pixi envs. Create a dedicated
uv virtual environment (paths assume the
sibling checkouts of rbig and gauss_flows):
cd projects/gaussianization
uv venv .venv-tutorials --python 3.13
uv pip install --python .venv-tutorials/bin/python \
-e ../../../rbig -e ../../../ml4eo/gauss_flows \
ipykernel jupyter nbconvert jupytext matplotlib seaborn
# Re-execute the whole section end-to-end:
.venv-tutorials/bin/jupyter nbconvert --to notebook --execute --inplace \
notebooks/00_foundations/0*.ipynb --ExecutePreprocessor.timeout=600Notebooks are paired (jupytext, py:percent): edit the .py, then
jupytext --sync to update the .ipynb. All notebooks set
jax_enable_x64 so log-determinant accumulation stays exact.