sequince_density.gmm.sklearn#

Scikit-learn Gaussian-mixture proposal adapter.

Classes#

GaussianMixtureProposal

Full-covariance Gaussian mixture fitted with scikit-learn.

Module Contents#

class sequince_density.gmm.sklearn.GaussianMixtureProposal(n_components, *, covariance_type='full', regularization=1e-06, max_iter=100, tol=0.0001)#

Full-covariance Gaussian mixture fitted with scikit-learn.

Fitting runs eagerly on CPU NumPy arrays. Density values and samples are restored to the namespace and device of the relevant input particles. Sampling uses orng.RandomGenerator rather than sklearn’s internal random state.

Weighted fitting is not supported by sklearn.mixture.GaussianMixture. The optional weights argument is accepted only to validate uniform SMC weights explicitly.

Parameters:
n_components#
covariance_type = 'full'#
regularization#
max_iter = 100#
tol#
property mixture_weights: numpy.ndarray#
Return type:

numpy.ndarray

property means: numpy.ndarray#
Return type:

numpy.ndarray

property covariances: numpy.ndarray#
Return type:

numpy.ndarray

property converged: bool#
Return type:

bool

property n_iter: int#
Return type:

int

property diagnostics: dict[str, Any]#

Return fit diagnostics consumed by proposal rejuvenation.

Return type:

dict[str, Any]

fit(particles, context=None, *, rng=None, weights=None)#

Fit the mixture to a two-dimensional particle array.

Parameters:
  • particles (Any)

  • context (Any | None)

  • rng (orng.RandomGenerator | int | None)

  • weights (Any | None)

Return type:

GaussianMixtureProposal

log_prob(particles, context=None)#
Parameters:
  • particles (Any)

  • context (Any | None)

sample(n_samples, context=None, *, rng=None, xp=None)#
Parameters:
  • n_samples (int)

  • context (Any | None)

  • rng (orng.RandomGenerator | int | None)

  • xp (Any | None)

sample_and_log_prob(n_samples, context=None, *, rng=None, xp=None)#
Parameters:
  • n_samples (int)

  • context (Any | None)

  • rng (orng.RandomGenerator | int | None)

  • xp (Any | None)

state_dict()#
Return type:

dict[str, Any]

load_state_dict(state)#
Parameters:

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

Return type:

None