Notation

A concise reference describing the notation used throughout the book (pp. xi–xiv). If you are unfamiliar with any of the corresponding mathematical concepts, chapters 2–4 describe most of these ideas. The typography carries meaning: italic aa is a scalar, bold a\boldsymbol{a} a vector, bold capital A\boldsymbol{A} a matrix, sans-serif A\mathsf{\mathbf{A}} a tensor — and upright roman a\mathrm{a}, a\mathbf{a}, A\mathbf{A} are their random-variable counterparts.

Numbers and Arrays

aa
A scalar (integer or real)
a\boldsymbol{a}
A vector
A\boldsymbol{A}
A matrix
A\mathsf{\mathbf{A}}
A tensor
In\boldsymbol{I}_n
Identity matrix with nn rows and nn columns
I\boldsymbol{I}
Identity matrix with dimensionality implied by context
e(i)\boldsymbol{e}^{(i)}
Standard basis vector [0,,0,1,0,,0][0,\dots,0,1,0,\dots,0] with a 1 at position ii
diag(a)\mathrm{diag}(\boldsymbol{a})
A square, diagonal matrix with diagonal entries given by a\boldsymbol{a}
a\mathrm{a}
A scalar random variable
a\mathbf{a}
A vector-valued random variable
A\mathbf{A}
A matrix-valued random variable

Sets and Graphs

A\mathbb{A}
A set
R\mathbb{R}
The set of real numbers
{0,1}\{0, 1\}
The set containing 0 and 1
{0,1,,n}\{0, 1, \dots, n\}
The set of all integers between 00 and nn
[a,b][a, b]
The real interval including aa and bb
(a,b](a, b]
The real interval excluding aa but including bb
A\B\mathbb{A} \backslash \mathbb{B}
Set subtraction, i.e., the set containing the elements of A\mathbb{A} that are not in B\mathbb{B}
G\mathcal{G}
A graph
PaG(xi)Pa_{\mathcal{G}}(\mathrm{x}_i)
The parents of xi\mathrm{x}_i in G\mathcal{G}

Indexing

aia_i
Element ii of vector a\boldsymbol{a}, with indexing starting at 1
aia_{-i}
All elements of vector a\boldsymbol{a} except for element ii
Ai,jA_{i,j}
Element i,ji, j of matrix A\boldsymbol{A}
Ai,:\boldsymbol{A}_{i,:}
Row ii of matrix A\boldsymbol{A}
A:,i\boldsymbol{A}_{:,i}
Column ii of matrix A\boldsymbol{A}
Ai,j,k\mathsf{A}_{i,j,k}
Element (i,j,k)(i, j, k) of a 3-D tensor A\mathsf{\mathbf{A}}
A:,:,i\mathsf{\mathbf{A}}_{:,:,i}
2-D slice of a 3-D tensor
ai\mathrm{a}_i
Element ii of the random vector a\mathbf{a}

Linear Algebra Operations

A\boldsymbol{A}^\top
Transpose of matrix A\boldsymbol{A}
A+\boldsymbol{A}^+
Moore-Penrose pseudoinverse of A\boldsymbol{A}
AB\boldsymbol{A} \odot \boldsymbol{B}
Element-wise (Hadamard) product of A\boldsymbol{A} and B\boldsymbol{B}
det(A)\det(\boldsymbol{A})
Determinant of A\boldsymbol{A}

Calculus

dydx\dfrac{dy}{dx}
Derivative of yy with respect to xx
yx\dfrac{\partial y}{\partial x}
Partial derivative of yy with respect to xx
xy\nabla_{\boldsymbol{x}}\, y
Gradient of yy with respect to x\boldsymbol{x}
Xy\nabla_{\boldsymbol{X}}\, y
Matrix derivatives of yy with respect to X\boldsymbol{X}
Xy\nabla_{\mathsf{\mathbf{X}}}\, y
Tensor containing derivatives of yy with respect to X\mathsf{\mathbf{X}}
fx\dfrac{\partial f}{\partial \boldsymbol{x}}
Jacobian matrix JRm×n\boldsymbol{J} \in \mathbb{R}^{m \times n} of f:RnRmf : \mathbb{R}^n \rightarrow \mathbb{R}^m
x2f(x) or H(f)(x)\nabla_{\boldsymbol{x}}^2 f(\boldsymbol{x}) \text{ or } \boldsymbol{H}(f)(\boldsymbol{x})
The Hessian matrix of ff at input point x\boldsymbol{x}
f(x)dx\displaystyle\int f(\boldsymbol{x})\, d\boldsymbol{x}
Definite integral over the entire domain of x\boldsymbol{x}
Sf(x)dx\displaystyle\int_{\mathbb{S}} f(\boldsymbol{x})\, d\boldsymbol{x}
Definite integral with respect to x\boldsymbol{x} over the set S\mathbb{S}

Probability and Information Theory

ab\mathrm{a} \bot \mathrm{b}
The random variables a\mathrm{a} and b\mathrm{b} are independent
abc\mathrm{a} \bot \mathrm{b} \mid \mathrm{c}
They are conditionally independent given c\mathrm{c}
P(a)P(\mathrm{a})
A probability distribution over a discrete variable
p(a)p(\mathrm{a})
A probability distribution over a continuous variable, or over a variable whose type has not been specified
aP\mathrm{a} \sim P
Random variable a\mathrm{a} has distribution PP
ExP[f(x)] or Ef(x)\mathbb{E}_{\mathrm{x} \sim P}[f(x)] \text{ or } \mathbb{E} f(x)
Expectation of f(x)f(x) with respect to P(x)P(\mathrm{x})
Var(f(x))\mathrm{Var}(f(x))
Variance of f(x)f(x) under P(x)P(\mathrm{x})
Cov(f(x),g(x))\mathrm{Cov}(f(x), g(x))
Covariance of f(x)f(x) and g(x)g(x) under P(x)P(\mathrm{x})
H(x)H(\mathrm{x})
Shannon entropy of the random variable x\mathrm{x}
DKL(PQ)D_{\mathrm{KL}}(P \| Q)
Kullback-Leibler divergence of P and Q
N(x;μ,Σ)\mathcal{N}(\boldsymbol{x}; \boldsymbol{\mu}, \boldsymbol{\Sigma})
Gaussian distribution over x\boldsymbol{x} with mean μ\boldsymbol{\mu} and covariance Σ\boldsymbol{\Sigma}

Functions

Sometimes we use a function f whose argument is a scalar but apply it to a vector, matrix, or tensor: f(x)f(\boldsymbol{x}), f(X)f(\boldsymbol{X}), or f(X)f(\mathsf{\mathbf{X}}). This denotes the application of ff to the array element-wise. For example, if C=σ(X)\mathsf{\mathbf{C}} = \sigma(\mathsf{\mathbf{X}}), then Ci,j,k=σ(Xi,j,k)\mathsf{C}_{i,j,k} = \sigma(\mathsf{X}_{i,j,k}) for all valid values of ii, jj and kk.

f:ABf : \mathbb{A} \rightarrow \mathbb{B}
The function ff with domain A\mathbb{A} and range B\mathbb{B}
fgf \circ g
Composition of the functions ff and gg
f(x;θ)f(\boldsymbol{x}; \boldsymbol{\theta})
A function of x\boldsymbol{x} parametrized by θ\boldsymbol{\theta}. (Sometimes we write f(x)f(\boldsymbol{x}) and omit the argument θ\boldsymbol{\theta} to lighten notation)
logx\log x
Natural logarithm of xx
σ(x)\sigma(x)
Logistic sigmoid, 11+exp(x)\dfrac{1}{1 + \exp(-x)}
ζ(x)\zeta(x)
Softplus, log(1+exp(x))\log(1 + \exp(x))
xp\|\boldsymbol{x}\|_p
LpL^p norm of x\boldsymbol{x}
x\|\boldsymbol{x}\|
L2L^2 norm of x\boldsymbol{x}
x+x^+
Positive part of xx, i.e., max(0,x)\max(0, x)
1condition\boldsymbol{1}_{\mathrm{condition}}
is 1 if the condition is true, 0 otherwise

Datasets and Distributions

pdatap_{\mathrm{data}}
The data generating distribution
p^data\hat{p}_{\mathrm{data}}
The empirical distribution defined by the training set
X\mathbb{X}
A set of training examples
x(i)\boldsymbol{x}^{(i)}
The ii-th example (input) from a dataset
y(i) or y(i)y^{(i)} \text{ or } \boldsymbol{y}^{(i)}
The target associated with x(i)\boldsymbol{x}^{(i)} for supervised learning
X\boldsymbol{X}
The m×nm \times n matrix with input example x(i)\boldsymbol{x}^{(i)} in row Xi,:\boldsymbol{X}_{i,:}