sequince_density.flows.coppuccino#

Eager copula normalizing flows backed by Coppuccino.

Classes#

CoppuccinoFlow

Fit one copula flow with unbounded marginals.

Module Contents#

class sequince_density.flows.coppuccino.CoppuccinoFlow(dims, *, seed=0, particle_transform=None, dtype=None, device=None, **kwargs)#

Bases: sequince_density.flows.base.Flow

Fit one copula flow with unbounded marginals.

Parameters:
  • dims (int) – Number of columns in the training and scoring arrays.

  • seed (int, default=0) – Seed for calls without an explicit RNG.

  • particle_transform (ParticleTransform, optional) – Outer coordinate transform. Bounded-to-unbounded and periodic transforms are unsupported.

  • dtype (dtype, optional) – If supplied, must be float64. The eager API uses NumPy float64.

  • device (optional) – Accepted for compatibility. JAX controls internal device placement.

  • **kwargs – Coppuccino training options, such as flow_layers or max_epochs.

xp#
fit(samples, context=None, *, rng=None, **kwargs)#

Fit to a finite array of shape (n_samples, dims).

Parameters:
Return type:

CoppuccinoFlow

forward(samples, context=None)#

Map particles to the base space with their log-Jacobian.

Parameters:
Return type:

tuple[sequince.typing.Array, sequince.typing.Array]

inverse(samples, context=None)#

Map base-space points to particle space with their log-Jacobian.

Parameters:
Return type:

tuple[sequince.typing.Array, sequince.typing.Array]

log_prob(samples, context=None)#

Return the log density of each point in particle space.

Parameters:
Return type:

numpy.ndarray

sample(n_samples, context=None, *, rng=None)#

Draw an array with shape (n_samples, dims).

Parameters:
Return type:

sequince.typing.Array

sample_and_log_prob(n_samples, context=None, *, rng=None)#

Draw particles and return their log densities in particle space.

Parameters:
Return type:

tuple[sequince.typing.Array, sequince.typing.Array]

state_dict()#

Capture the fitted model, outer transform, and local RNG state.

Return type:

dict[str, Any]

load_state_dict(state)#

Restore state from a trusted checkpoint.

Parameters:

state (collections.abc.Mapping[str, Any])

Return type:

None