liveBook · Manning

Chapter 5: Probability distributions in machine learning

What you will learn in chapter 5 of Math and Architectures of Deep Learning

This introduction motivates probability distributions as tools for modeling uncertain, high-dimensional machine-learning data and previews the chapter’s probabilistic and PyTorch-based approach.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction motivates probability distributions as tools for modeling uncertain, high-dimensional machine-learning data and previews the chapter’s probabilistic and PyTorch-based approach.

Key terms: feature vectors, high-dimensional space, probability distributions, clusters, correlation, probabilistic models, semantic segmentation, foreground, background, variational autoencoders

5.1 Probability: The classical frequentist view

This section introduces the frequentist definition of probability as the fraction of a population that satisfies an event's specified criteria.

Key terms: frequentist paradigm, event, favorable outcomes, possible outcomes, population, superset, probability

5.1.1 Random variables

This section defines random variables as numerical quantities whose possible values or ranges have probabilities, distinguishing discrete and continuous cases.

Key terms: random variable, event, allowed value, value range, probability, discrete random variable, countable set, quantized weight, X = 1, X = 2

5.1.2 Population histograms

This subsection shows how a population histogram displays counts for the possible categories of a discrete random variable.

Key terms: population histogram, discrete random variable, X-axis, Y-axis, S1, S2, S3, entire adult population, population size

5.2 Probability distributions

This section defines a discrete probability distribution using quantized adult weights and explains why its events must be exhaustive and mutually exclusive.

Key terms: probability distribution, random variable, allowed values, discrete random variable, quantized weight, exhaustive, mutually exclusive, set union, set intersection, S1

5.3 Basic concepts of probability theory

5.3.1 Probabilities of impossible and certain events

This subsection distinguishes impossible and certain events from merely improbable and highly probable events using probability values.

Key terms: impossible event, probability, certitude, improbable events, highly probable events, nonzero probabilities

5.3.2 Exhaustive and mutually exclusive events

This subsection defines exhaustive and mutually exclusive events using quantized weight ranges and establishes that their probabilities sum to one.

Key terms: exhaustive events, union, population space, S1, S2, S3, mutually exclusive events, mutual intersections, null intersections, E1

5.3.3 Independent events

This subsection defines independent events as events for which knowing one provides no information about the other.

Key terms: independent events, E1, G1

5.4 Joint probabilities and their distributions

This section defines joint probability and shows how the joint distribution of independent event categories is formed by multiplying their individual probabilities.

Key terms: joint probability, p(E1, G1), events occurring together, joint probability distribution, product rule, independent events, p(Ei, Gj) = p(Ei)p(Gj), Cartesian product, ∏

5.4.1 Marginal probabilities

This section shows how to recover an individual event’s marginal probability from a joint probability table by summing over all exhaustive, mutually exclusive values of the other event.

Key terms: marginal probability, joint probability distribution, joint probabilities, exhaustive events, mutually exclusive events, certain event, factor out

5.4.2 Dependent events and their joint probability distribution

This section illustrates how a joint probability table represents dependent height and weight events, using a toy case of perfect correlation.

Key terms: dependent events, independent events, joint probability distribution, height, weight, p(Ei, Fj), perfectly correlated, Ei, Fj, Table 5.7

5.5 Geometrical view: Sample point distributions for dependent and independent variables

This section visualizes joint discrete distributions as sampled point clouds to contrast independent and dependent variables and relate correlation to dimensionality reduction.

Key terms: joint distribution, joint event, bucket, sample point distribution, independent events, dependent events, correlated events, joint probability samples, joint space, principal component analysis (PCA)

5.6 Continuous random variables and probability density

This section extends discrete frequency-based probability distributions to continuous random variables through probability density functions whose total integral is one.

Key terms: quantized random variables, buckets, probability density function, p(x), frequentist approach, random variable, E = limδx→0 {x ≤ X < x + δx}, exhaustive, mutually exclusive, continuous counterparts

5.7 Properties of distributions: Expected value, variance, and covariance

This section introduces expected value, variance, and covariance as common distribution parameters needed to fit and understand probabilistic generative models.

Key terms: generative machine learning models, parameterized distribution, distribution family, training data, mean, variance, expected value, covariance, geometric significance, individual distributions

5.7.1 Expected value (aka mean)

This section defines expected value as a probability-weighted average, extends it to functions and linear combinations of random variables, and relates it to centroids and dot products.

Key terms: expected value, mean, probability-weighted average, discrete random variable, continuous random variable, expected value of a function, f(X), dot product, probability vector, function vector

5.7.2 Variance, covariance, and standard deviation

This section defines variance and standard deviation as measures of spread around a mean, then generalizes directional spread to multivariate data through the covariance matrix.

Key terms: variance, standard deviation, expected value, mean, spread, dimensionality reduction, PCA, packing density, noise, variation

5.8 Sampling from a distribution

This section explains how samples represent a probability distribution and how sample statistics and the law of large numbers let us estimate population properties from finite data.

Key terms: sample, sample point cloud, population, univariate, multivariate, sample mean, sample variance, true mean, closed-form expressions, law of large numbers

5.9 Some famous probability distributions

This introduction previews how the following subsections use PyTorch and formulas to work with common deep-learning probability distributions and compare theoretical and sampled properties.

Key terms: PyTorch distributions function call, raw evaluation from the formula, theoretical mean, sample mean, theoretical variance, sample variance, logarithm of the probability, exponential distributions

5.9.1 Uniform random distributions

This section defines univariate and multivariate uniform distributions and derives their density, mean, and variance.

Key terms: uniform probability distribution, continuous random variable, probability density function, univariate, interval [a,b], expected value, mean, variance, uniform interval, width

5.9.2 Gaussian (normal) distribution

This section defines univariate and multivariate Gaussian distributions, relates their parameters to moments, and explains how covariance determines the geometry of Gaussian density surfaces and sampled point clouds.

Key terms: Gaussian distribution, normal distribution, probability density function, μ, σ, asymptotically approaching zero, expected value, mean, variance, standard deviation

5.9.3 Binomial distribution

This section defines the binomial distribution for counting successes across repeated binary trials, derives its probability formula, and states its mean and variance.

Key terms: binomial distribution, trial, success, failure, probability of success, π, binomial coefficient, combination, k successes, n trials

5.9.4 Multinomial distribution

This section defines the multinomial distribution for counts of multiple mutually exclusive classes across repeated trials and gives its probability, mean, variance, and covariance.

Key terms: multinomial distribution, classes, mutually exclusive, exhaustive, random trial, random variables, multinomial probability function, k1,…,km, n trials, multinomial coefficient

5.9.5 Bernoulli distribution

This section defines the Bernoulli distribution as a one-trial binary distribution and derives its mean and variance after encoding outcomes as 1 and 0.

Key terms: Bernoulli distribution, binomial distribution, success, failure, discrete random variable, π, expected value, mean, variance, success = 1

5.9.6 Categorical distribution and one-hot vectors

This section defines the categorical distribution as a one-trial multinomial distribution, represents its outcomes with one-hot vectors, and expresses its probabilities compactly.

Key terms: categorical distribution, multinomial distribution, Bernoulli distribution, mutually exclusive, exhaustive, class probabilities, one-hot vector, class, outcome, categorical probability function

5.10 Summary

This summary recaps probability distributions, sampling and statistical moments, then connects covariance, PCA, and the geometry of Gaussian distributions.

Where this is used later

Concepts explained in this chapter

← Chapter 4: Linear algebraic tools in machine learning Chapter 6: Bayesian tools for machine learning →

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.