Categorical distribution
A categorical distribution is a discrete probability distribution over a finite set of mutually exclusive categories or outcomes.
Fabulous Adventures in Data Structures and Algorithms
A categorical distribution assigns probabilities to a finite set of mutually exclusive categories.
- How it is used
- Represents weighted finite random choices and supports sampling and later Bayesian calculations.
- How deep it goes
- Develops projected weights and compares four sampling algorithms, including alias construction and its costs.
- Examples
- Uses a color-labeled die, zero-weight histogram, and cold-and-sneezing joint distribution.
- What you can do after
- Build it from scratch in C# with integer weights, or apply `ToCategorical` and `ToJoint` to weighted values.
Read how Fabulous Adventures in Data Structures and Algorithms explains categorical distribution →
Causal AI
Categorical is a Pyro distribution object representing a categorical probability distribution.
- How it is used
- Represents discrete outcomes and supplies a Pyro object for randomly generating category indices.
- How deep it goes
- Defines categories, probabilities, discrete notation, and Pyro sampling, but does not develop categorical inference or parameter estimation.
- Examples
- Uses food categories, probabilities [.45, .30, .25], Pyro construction, and sampled indices such as tensor(1.).
- What you can do after
- Apply it via Pyro by constructing a Categorical object with probabilities and calling sample() for random category generation.
Math and Architectures of Deep Learning
A discrete probability distribution over exactly one of several mutually exclusive classes in a single trial.
- How it is used
- Frames single-trial class uncertainty for machine-learning problems involving classification and probability distributions.
- How deep it goes
- Defines class probabilities, relates categorical to Bernoulli and multinomial distributions, and represents outcomes with one-hot vectors.
- Examples
- Uses a four-class photo database containing Einstein, Curie, Gauss, and other-photo outcomes.
- What you can do after
- Evaluate/understand single-trial class probabilities and encode outcomes as one-hot vectors.
Read how Math and Architectures of Deep Learning explains categorical distribution →
Related concepts
- maximum likelihood estimationequivalent to · Maximum likelihood estimation is a statistical method that selects parameter values maximizing the likelihood of observed data under a specified probabilistic model.
- Pointer Networkproduced by · A Pointer Network is an attention-based sequence-to-sequence neural architecture that outputs positions or elements selected from its input sequence.
- Bernoulli distributionincludes · A Bernoulli distribution is a discrete probability distribution for one binary outcome, assigning probability p to one outcome and 1−p to the other.
- gumbel-softmaxused by · Gumbel-Softmax is a differentiable approximation that samples from categorical distributions while enabling gradient-based optimization.
- uniform distributionincludes · A uniform distribution assigns equal probability to each outcome in a discrete support or constant probability density across a continuous interval.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


