zuko.flows.spline#

Spline flows.

Classes#

NSF

Creates a neural spline flow (NSF) with monotonic rational-quadratic spline transformations.

NCSF

Creates a neural circular spline flow (NCSF).

Descriptions#

class zuko.flows.spline.NSF(features, context=0, bins=8, **kwargs)#

Creates a neural spline flow (NSF) with monotonic rational-quadratic spline transformations.

By default, transformations are fully autoregressive. Coupling transformations can be obtained by setting passes=2.

Warning

Spline transformations are defined over the domain \([-5, 5]\). Any feature outside of this domain is not transformed. It is recommended to standardize features (zero mean, unit variance) before training.

References

Neural Spline Flows (Durkan et al., 2019)
Parameters:
  • features (int) – The number of features.

  • context (int) – The number of context features.

  • bins (int) – The number of bins \(K\).

  • kwargs – Keyword arguments passed to zuko.flows.autoregressive.MAF.

class zuko.flows.spline.NCSF(features, context=0, bins=8, **kwargs)#

Creates a neural circular spline flow (NCSF).

Circular spline transformations are obtained by composing circular domain shifts with regular spline transformations. Features are assumed to lie in the half-open interval \([-\pi, \pi[\).

References

Normalizing Flows on Tori and Spheres (Rezende et al., 2020)
Parameters:
  • features (int) – The number of features.

  • context (int) – The number of context features.

  • bins (int) – The number of bins \(K\).

  • kwargs – Keyword arguments passed to zuko.flows.autoregressive.MAF.