TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tfp.edward2.Categorical

View source on GitHub

Create a random variable for Categorical.

Aliases:

tfp.edward2.Categorical(
    *args,
    **kwargs
)

See Categorical for more details.

Returns:

RandomVariable.

Original Docstring for Distribution

Initialize Categorical distributions using class log-probabilities.

Args:

  • logits: An N-D Tensor, N >= 1, representing the unnormalized log probabilities of a set of Categorical distributions. The first N - 1 dimensions index into a batch of independent distributions and the last dimension represents a vector of logits for each class. Only one of logits or probs should be passed in.
  • probs: An N-D Tensor, N >= 1, representing the probabilities of a set of Categorical distributions. The first N - 1 dimensions index into a batch of independent distributions and the last dimension represents a vector of probabilities for each class. Only one of logits or probs should be passed in.
  • dtype: The type of the event samples (default: int32).
  • validate_args: Python bool, default False. When True distribution parameters are checked for validity despite possibly degrading runtime performance. When False invalid inputs may silently render incorrect outputs.
  • allow_nan_stats: Python bool, default True. When True, statistics (e.g., mean, mode, variance) use the value "NaN" to indicate the result is undefined. When False, an exception is raised if one or more of the statistic's batch members are undefined.
  • name: Python str name prefixed to Ops created by this class.