Learn

Maths for machine learning

The maths behind the models, starting from the symbols themselves. If a paper loses you at ∑, ∇ or ‖x‖₂, begin with the notation explorer.

Maths for ML, module by module

One idea per lesson, five to ten minutes each, with something to play with and a short quiz.

  1. Module 0 · Reading maths

    1. 1Letters and the little numbers: xᵢ, x², x⁽ⁱ⁾
    2. 2Plain, bold and capital letters; hats, bars and stars
    3. 3Σ and Π are for-loops
    4. 4Sets, ℝ and shapes: what W ∈ ℝ^(m×n) tells you
    5. 5Functions and arrows: f: ℝⁿ → ℝ, ↦ and f ∘ g
  2. Module 1 · Vectors

    1. 1Vectors: arrows and arrays
    2. 2The dot product and the angle between vectors
    3. 3Norms: how big is a vector?
    4. 4Linear combinations and span: which points can you reach?
  3. Module 2 · Matrices

    1. 1A matrix is a transformation
    2. 2Multiplying matrices: check the shapes first
    3. 3Transpose, identity, inverse and determinant
    4. 4Special matrices: diagonal, symmetric, orthogonal, triangular, sparse
    5. 5Tensors and broadcasting
  4. Module 3 · Decompositions

    1. 1Eigenvectors: the directions a matrix only stretches
    2. 2The SVD: rotate, stretch, rotate
    3. 3PCA: the directions where the data varies most
  5. Module 4 · Calculus for ML

    1. 1The derivative: slope, and sensitivity
    2. 2Partial derivatives and the gradient
    3. 3The chain rule, run backwards: backpropagation
    4. 4Jacobians and Hessians: derivatives as tables
  6. Module 5 · Probability and statistics

    Coming soon

  7. Module 6 · Optimization

    Coming soon

  8. Module 7 · Putting it together

    Coming soon

Reference notes

Condensed summaries of the maths behind modern models, for readers who already know the basics.

  1. 1Linear Algebra, Vector Spaces & Matrix Calculus
  2. 2Probability Distributions, Maximum Likelihood & MAP
  3. 3Information Theory, Entropy & Divergence Measures
  4. 4Convexity, Optimization Dynamics & Duality
  5. 5Matrix Decompositions, SVD & Low-Rank Adaptation (LoRA)
  6. 6Deep Neural Representations & Normalization Mathematics
  7. 7Transformer Mathematics: Attention Scaling, RoPE & Latent Projections
  8. 8Continuous Flow Matching ODEs & Post-Training RL Mathematics