Notation
Clear, consistent notation makes it much easier to connect mathematical ideas to code across a book that spans linear algebra, calculus, probability, optimization, and modern neural architectures. Throughout this book, we adhere to a uniform typographic hierarchy: lowercase italic letters () denote scalars, bold lowercase letters () denote vectors, bold uppercase letters () denote matrices, sans-serif uppercase letters () denote higher-order tensors, calligraphic letters () denote sets, and uppercase italic letters () denote random variables.
In the reference lists below, the indefinite article "a" indicates a general typographic convention (for example, ": a scalar" means that lowercase italic letters generally represent scalars), whereas the definite article "the" indicates a symbol with a specific fixed meaning, such as ": the set of real numbers".
Because the alphabet is finite, a few standard letters carry more than one meaning across subfields. In every case, the syntactic form and context of the symbol disambiguate it: for example, the sigmoid function takes a parenthesized argument, a standard deviation carries a random variable as a subscript, a singular value is indexed and applied to a matrix, and the noise schedule of a diffusion model is indexed by time . We note potential ambiguities explicitly below. Chapters that introduce a larger domain-specific vocabulary also open with a dedicated notation table, including optimization (Table 23.1), information theory (Table 25.1.1), dynamics (Table 26.1), reinforcement learning (Table 14.1.1), generative adversarial networks (Table 16.1), and diffusion models (Table 17.2.1). The final sections of this chapter summarize the core notation for several advanced topics.
Numerical Objects#
- : a scalar
- : a vector (by default a column vector)
- : the column vector with entries written inline; a matrix row is written the same way in running text, as in "the rows and "
- : a matrix
- : a tensor with more than two axes
- : the identity matrix of a contextually determined dimension (a square matrix with on the main diagonal and everywhere else)
- , : the vectors of all zeros and all ones of a contextually determined dimension
- : the element of vector
- , : the element of matrix at row and column
Set Theory#
- : a set
- : the set of real numbers
- : the set of -dimensional real vectors
- : the set of real matrices with rows and columns
- : the cardinality (number of elements) of set
- : the union of sets and
- : the intersection of sets and
- : the set difference (the elements of that do not belong to )
Functions and Operators#
- : a function
- : the natural logarithm (base )
- : the base- logarithm
- : the exponential function
- : the logistic sigmoid function,
- : the softmax vector with entries
- : the indicator function, equal to when its Boolean argument is true and otherwise (distinguished from the all-ones vector by taking an argument)
- , : a value of that maximizes or minimizes
- : summation over a collection of elements
- : product over a collection of elements
- : an asymptotic upper bound up to a constant factor, as in a cost of operations
- : proportional to (the two sides differ by a constant factor independent of the variable of interest)
- : equality by definition of the symbol on the left-hand side
Linear Algebra#
- : the transpose of a vector or matrix
- : the inverse of square matrix
- : the Moore–Penrose pseudoinverse of matrix
- : the inner (dot) product of vectors and , also written
- : the Hadamard (elementwise) product
- : concatenation of vectors or matrices
- : the vector norm
- : the Euclidean () norm
- : the spectral (operator) norm of matrix , equal to its largest singular value
- : the Frobenius norm of matrix , equal to the norm of its entries
- : the nuclear (trace) norm of matrix , equal to the sum of its singular values
- : the diagonal matrix with the entries of vector on its main diagonal
- , , : the rank, trace, and determinant of matrix
- , : an eigenvalue of a square matrix, and the largest eigenvalue of a symmetric matrix
- : the largest singular value of matrix (not to be confused with the sigmoid function )
- : the condition number of matrix , equal to the ratio of its largest to its smallest nonzero singular value
- : the spectral radius of a square matrix , equal to the largest absolute value (modulus) among its eigenvalues (not to be confused with the correlation coefficient below)
- , : the symmetric matrix is positive semidefinite () or positive definite ()
Calculus#
- , : the derivative of with respect to , and the derivative of evaluated at
- : the partial derivative of with respect to
- : the gradient of scalar with respect to vector
- , : the Jacobian matrix of vector-valued function with respect to
- : the Hessian matrix of , containing its second-order partial derivatives
- , : the divergence of vector field and the Laplacian of scalar function
- : the definite integral of from to with respect to
- : the indefinite integral (antiderivative) of with respect to
Probability and Information Theory#
- : a random variable
- : a probability distribution
- : the random variable follows distribution
- : the probability assigned to the event that random variable takes the value
- : the conditional probability distribution of given
- : a probability density function (PDF) or probability mass function (PMF) associated with distribution
- : the expectation of random variable
- : the expectation of when is drawn from distribution
- : random variables and are statistically independent
- : random variables and are conditionally independent given
- , : a standard deviation in general, and the standard deviation of random variable in particular
- : the variance of random variable , equal to
- : the covariance of random variables and
- : a covariance matrix
- : the Pearson correlation coefficient between and , equal to
- : the univariate Gaussian (normal) distribution with mean and variance ; denotes its multivariate form
- , : the Shannon entropy of a discrete random variable , and the differential entropy of a continuous random variable
- : the mutual information between random variables and
- : the Kullback–Leibler (KL) divergence (relative entropy) from distribution to distribution
Data, Models, and Training#
- : the number of examples in a dataset
- : the number of input features (dimensionality of an example)
- , : the feature vector and target label of the example
- : a dataset, such as
- : a design matrix or minibatch matrix, arranged with one example per row
- : a minibatch of examples, of size
- : a model's prediction of target
- , : the weight vector and scalar bias of a linear model
- , : the weight matrix and bias vector of layer , as in
- , : the parameters of a model (written in bold when collected into a single vector)
- , : a per-example loss function
- : the empirical loss averaged over a dataset or minibatch
- : the learning rate (step size) of a gradient-based optimizer
- : the regularization strength of an weight-decay penalty
- , : a discrete or continuous time step , and the total length of a sequence
- , : the input and hidden state at time step
Attention and Transformers#
These symbols are introduced in Chapter 10 and used throughout Chapter 11 and the chapters that build on it.
- , , : a query vector, and the key and value vectors of item (Section 10.1)
- : an attention scoring function, such as for scaled dot-product attention
- : the attention weight assigned to key , obtained by applying the softmax function to the scores across all keys
- , , : the stacked matrices of queries, keys, and values (one per row), which scaled dot-product attention maps to (Section 10.2)
- , : the dimension (width) of queries and keys (), and of values ()
- , : the number of attention heads and the per-head dimension, (Section 10.3)
State Space Models#
These symbols are introduced in Chapter 12.
- , , , : the state transition matrix, input projection, output readout, and feedthrough (skip) term of a state space model (Section 12.4.1.1)
- : the latent state dimension per channel
- : the diagonal entry (rate) of a diagonal state matrix, whose corresponding state component decays by per step
- , : the discretization step size (Section 12.4.1.2), and its input-dependent (selective) counterpart in Mamba (Section 12.5)
- : a matrix-valued recurrent state updated via outer products and read with a query (Section 12.6); here the key dimension is written alongside the value dimension
- : the write strength (learning rate) of the delta update rule (Section 12.7)
Reinforcement Learning#
These symbols are used across Chapter 14 and Chapter 15; Table 14.1.1 provides a complete listing along with the section where each symbol is defined.
- , : the state space and action space
- , , : the state, action, and scalar reward at time step
- : the Markov transition kernel giving the probability of transitioning to state from state under action
- : the expected immediate reward for taking action in state
- : the discount factor,
- , : a trajectory and its discounted return
- : a stochastic policy giving the probability of selecting action in state ; for a deterministic policy, denotes the chosen action
- , : a parameterized policy with parameters , and its expected discounted return
- , : the state-value and action-value functions under policy (the expected return starting from state , and starting from state after taking action )
- , : the optimal state-value and action-value functions
- : the advantage function,
- : the temporal-difference (TD) error at step
- : the exploration probability in -greedy action selection
Generative Adversarial Networks#
These symbols belong to Chapter 16; Table 16.1 lists every symbol along with its defining section and common alternatives in the literature.
- , , : the true data density, the generator's model density, and their equal mixture
- , : a real sample drawn from the data distribution and a synthetic sample drawn from the generator
- : the binary source label of a sample ( for real data and for generated samples)
- , : the latent noise variable and the generator network, producing
- : the critic's (or discriminator's) realness logit, so that represents the estimated probability that sample is real
- : the value function of the minimax log-loss game
- , : the likelihood ratio (density ratio) and log-density ratio
- : the Bayes-optimal class posterior probability that a sample is real (note that within Chapter 16, the optimizer step size is written rather than )
- , : a divergence function and its -divergence
- , : the pairing (relativistic) objective and its value at the optimal critic
- , , : the gradient-penalty weight and the zero-centered gradient penalties evaluated on real data () and generated samples ()
- : a conditioning variable, such as a class label or text prompt
Diffusion Models#
These symbols belong to Chapter 17 and match the conventions of Chapter 26 (Table 26.1). Throughout this book, we use a single unified time direction: clean data reside at , pure noise resides at , and generative samplers integrate backward from down to . (Note that some flow-matching papers reverse this convention; see Section 17.2.) The chapter collects its symbols, with the notations papers use for them, in Table 17.2.1.
- , : a clean data point and an independent standard Gaussian noise vector,
- : the noisy state at time along a Gaussian probability path
- , : the signal and noise schedule coefficients along the path (distinct from a learning rate or the standard deviation of the data)
- , : the squared signal coefficient of the variance-preserving path and its rate (Section 17.2)
- , , : a step of the DDPM chain, the number of steps, and the variance added at step (Section 17.2)
- : the log signal-to-noise ratio (log-SNR), which decreases monotonically from at clean data () to at pure noise ()
- , : the marginal density of at time and its score function
- , : the posterior expectations and predicted by a denoising network
- , , : the probability-flow velocity field that transports samples along the path, a neural network parameterized by trained to approximate it, and that network's predicted velocity
- , : the coordinates in which every Gaussian path reads and the samplers take their steps (Section 17.3); here the bar means division by , not the square it denotes in
- : the target vector in -prediction (Section 17.2)
- : the classifier-free guided velocity field (Section 17.4.4.2)
- , : the average velocity between times and , and the reference velocity (either a teacher model's prediction or the conditional velocity ) used in few-step distillation losses (Section 17.8)
- , : a conditioning signal and the guidance scale (Section 17.4.4.2)