liveBook · Manning

Categorical distribution

As explained in Math and Architectures of Deep Learning

A discrete probability distribution over exactly one of several mutually exclusive classes in a single trial.

A categorical distribution models one trial in which exactly one of several mutually exclusive and exhaustive classes occurs. With class probabilities π₁, …, πₘ, each probability is nonnegative and their sum is 1. It is the single-trial case of the multinomial distribution and extends Bernoulli beyond two classes. section 5.9.6

p(Ci) = πi

Use the probability table to map each class Cᵢ to its probability p(Cᵢ) = πᵢ. section 5.9.6

A four-class photo database

A randomly selected photo belongs to one of four classes: Albert Einstein (0.10), Marie Curie (0.42), Carl Friedrich Gauss (0.04), or other (0.44). The probabilities sum to 1 because one and only one class occurs. A Marie Curie outcome can be encoded as the one-hot vector whose Marie Curie position is 1 and every other position is 0. section 5.9.6

Key representations:

  • The probability vector describes the possible classes for a single trial. section 5.9.6
  • A one-hot vector has m elements, exactly one equal to 1, and all others equal to 0. section 5.9.6
  • Each individual class indicator follows a Bernoulli distribution, while the complete outcome represents the categorical distribution. section 5.9.6

How Math and Architectures of Deep Learning covers it

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.
How it connects
Connects categorical distributions to Bernoulli distributions, multinomial distributions, probability vectors, and one-hot vectors.

Also explained in

Compare how 3 books explain categorical distribution →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math and Architectures of Deep Learning. The section links point to the parts of the book it draws on.