Course / 02

Mathematics for Machine Learning

The linear algebra, calculus and optimization that machine learning is written in: vector spaces and the matrix decompositions, derivatives of functions of vectors and matrices, convexity, Lagrange duality, and what floating point does to all of it.

Before you start: school algebra and the derivative of a function of one variable. Proofs are given where they are short and explain why a result holds; longer ones are marked as optional depth. Every note ends with a Code section in Python with NumPy that checks its results numerically. The Probability course can be taken alongside this one; Machine Learning builds on both.

The plan of the course → · The course in one paragraph →

  1. Linear algebra
  2. Calculus
  3. Optimization
  4. Numerics
  1. 01

    Linear Algebra

    Vectors, matrices and the decompositions that machine learning runs on.

    After this section: Solve linear systems and least-squares problems, project onto subspaces, diagonalize a symmetric matrix and compress a matrix with its SVD.

    6 of 6 notes published
  2. 02

    Calculus

    Derivatives of functions of many variables, written so that they compute.

    After this section: Compute gradients, Jacobians and Hessians, differentiate expressions in vectors and matrices with the chain rule, and change variables in a multiple integral.

    4 of 4 notes published
  3. 03

    Optimization

    When a minimum exists, how to find it, and what constraints change.

    After this section: Recognize a convex problem, state optimality conditions, analyse gradient descent and Newton's method, and solve a constrained problem with Lagrange multipliers, KKT conditions and its dual.

    4 of 4 notes published
  4. 04

    Numerical Computation

    What changes when the arithmetic is done by a computer.

    After this section: Estimate how errors in the data and in floating point grow through a computation, and choose a stable way to solve a linear or least-squares problem, directly or by an iterative method.

    2 of 2 notes published