mxnet.gluon.probability.distributions.one_hot_categorical¶
One-hot Categorical Distribution
Classes
|
Create a one-hot categorical distribution object. |
- class mxnet.gluon.probability.distributions.one_hot_categorical.OneHotCategorical(num_events, prob=None, logit=None, validate_args=None)[source]¶
Bases:
DistributionCreate a one-hot categorical distribution object.
- Parameters:
num_events (Int) – Number of events.
prob (Tensor) – Probabilities of each event.
logit (Tensor) – The log-odds of each event
- broadcast_to(batch_shape)[source]¶
Returns a new distribution instance with parameters expanded to batch_shape. This method calls numpy.broadcast_to on the parameters.
- Parameters:
batch_shape (Tuple) – The batch shape of the desired distribution.
- enumerate_support()[source]¶
Returns a tensor that contains all values supported by a discrete distribution.
- log_prob(value)[source]¶
Returns the log of the probability density/mass function evaluated at value.
- property mean¶
Returns the mean of the distribution.
- property variance¶
Returns the variance of the distribution.