v0.4.0 — drop zuko runtime dependency
Highlights
zflows is now a standalone PyTorch package. The internals previously imported from zuko (Transform subclasses, MaskedMLP, the adaptive ODE solver, the vmap/grad plumbing) have been vendored into zflows.core/ and specialised for the unconditional setting only — every context / c=None argument is gone, so the only distribution a flow ever sees is the one fixed target.
The public API (zflows.flow, zflows.potential, zflows.loss, zflows.utils) and every flow constructor signature is unchanged; downstream code from v0.3.x keeps working with no edits.
Behavioural changes
-
NSF / NCSF parameterise their inner spline on per-coordinate
$[-\text{halfwidth}_i, \text{halfwidth}_i]$ and wrap it with a translation-onlyAdditiveTransformsandwich (no scaling). The box geometry$[a, b]^d$ is honoured natively without distorting the conditioner's dynamic range. -
MonotonicRQSTransformandCircularShiftTransformnow accept a per-coordinateboundtensor, not just a scalar. - The
Flow.t() -> ComposedTransformcontract is preserved across NSF / NCSF / CNF / RealNVP.
Dependencies
- Runtime:
torch>=2.10.0,numpy>=2.4.0. zukois no longer required.
Verification
Two new correctness scripts ship under tests/:
tests/_verify_NSF_NCSF.py— 7 checks (round-trip,zeros()identity,call_and_ladj≈ autogradslogdet, box preservation,CircularShiftper-coord wrap, translation-sandwich invariant).tests/_verify_CNF_RealNVP.py— 7 checks (round-trip,zeros()identity,slogdetagreement, RealNVP forward+inverse ladj cancellation, CNF Hutchinson unbiasedness, backprop coverage).
The end-to-end demos in tests/ all pass against this release.
🤖 Generated with Claude Code