# LostTech.TensorFlow : API Documentation

Type Categorical

Namespace tensorflow.distributions

Parent Distribution

Interfaces ICategorical

Categorical distribution.

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

The Categorical distribution is closely related to the `OneHotCategorical` and `Multinomial` distributions. The Categorical distribution can be intuited as generating samples according to `argmax{ OneHotCategorical(probs) }` itself being identical to `argmax{ Multinomial(probs, total_count=1) }`.

#### Mathematical Details

The probability mass function (pmf) is,

```none pmf(k; pi) = prod_j pi_j**[k == j] ```

#### Pitfalls

The number of classes, `K`, must not exceed: - the largest integer representable by `self.dtype`, i.e., `2**(mantissa_bits+1)` (IEEE 754), - the maximum `Tensor` index, i.e., `2**31-1`.

In other words, Note: This condition is validated only when `self.validate_args = True`.

#### Examples

Creates a 3-class distribution with the 2nd class being most likely. Creates a 3-class distribution with the 2nd class being most likely. Parameterized by [logits](https://en.wikipedia.org/wiki/Logit) rather than probabilities. Creates a 3-class distribution with the 3rd class being most likely. The distribution functions can be evaluated on counts.
Show Example
```K <= min(2**31-1, {
tf.float16: 2**11,
tf.float32: 2**24,
tf.float64: 2**53 }[param.dtype]) ```

### Public properties

#### Tensorevent_size get;

Scalar `int32` tensor: the number of classes.

#### objectevent_size_dyn get;

Scalar `int32` tensor: the number of classes.

#### objectlogits get;

Vector of coordinatewise logits.

#### objectlogits_dyn get;

Vector of coordinatewise logits.

#### Tensorprobs get;

Vector of coordinatewise probabilities.

#### objectprobs_dyn get;

Vector of coordinatewise probabilities.