Skip to content

Categorical¤

distreqx.distributions.categorical.Categorical (AbstractSTDDistribution, AbstractSampleLogProbDistribution, AbstractSurivialDistribution) ¤

Categorical distribution over integers.

The Categorical distribution is parameterized by either probabilities (probs) or unormalized log-probabilities (logits) of a set of K classes. It is defined over the integers {0, 1, ..., K-1}.

__init__(self, logits: Optional[Array] = None, probs: Optional[Array] = None) ¤

Initializes a Categorical distribution.

Arguments:

  • logits: Logit transform of the probability of each category. Only one of logits or probs can be specified.
  • probs: Probability of each category. Only one of logits or probs can be specified.