probly.representation.distribution.mixture_dirichlet

Mixture distribution for Dirichlet components.

Classes

ArrayDirichletMixture(components, weights)

Dirichlet mixture distribution.

class probly.representation.distribution.mixture_dirichlet.ArrayDirichletMixture(components, weights)[source]

Bases: object

Dirichlet mixture distribution.

Parameters:
sample(num_samples, rng=None)[source]

Sample from the mixture.

Returns:

ArraySample

Samples with shape: (num_samples, *alphas.shape).

Parameters:
Return type:

ArraySample

property T: Self

The transposed version of the distribution.

components: Sequence[ArrayDirichlet]
property device: str

The device of the underlying array.

property dtype: DTypeLike

The data type of the underlying array.

property ndim: int

Number of batch dimensions (excluding category axis).

property shape: tuple[int, ...]

Batch shape (excluding category axis).

property size: int

The total number of distributions.

weights: np.ndarray