BernoulliDistribution

class probly.representation.distribution.BernoulliDistribution(*args, **kwargs)[source]

Bases: CategoricalDistribution, Generic

Base class for Bernoulli distributions.

Bernoulli distributions are represented by the probability of class 1 and can be viewed as two-class categorical distributions.

entropy() → ArrayLike[source]

Compute entropy.

abstract property log_probabilities: T

Get the log probabilities of the categorical distribution.

abstract property logits: T

Get logits of the categorical distribution.

property num_classes: int

Get the fixed number of Bernoulli classes.

abstract property probabilities: T

Get the probabilities of the categorical distribution.

abstractmethod sample(num_samples: int) → Sample[T][source]

Draw samples from Distribution.

abstractmethod to_categorical() → CategoricalDistribution[source]

Convert to a two-class categorical distribution.

type: ClassVar[Literal['categorical', 'bernoulli']] = 'bernoulli'
abstract property unnormalized_probabilities: T

Get unnormalized probabilities of the categorical distribution.