🧮 Self-paced course · companion to Statistics for AI

Math for AI: Linear Algebra & Calculus Essentials

The vectors, matrices, derivatives and integrals that AI and machine learning use. Each one ties to something a model does.

7 lessons Sequential — each builds on the last High-school algebra is enough Quizzes included

Linear algebra

  1. Vectors: Embeddings, Dot Products & Measuring Similarity

    A vector is a list of numbers that can be a point, an arrow, or a meaning. Add them, measure them, take dot products, and learn why dot product, cosine, and distance pick different winners in retrieval.

  2. Matrices: Transformations, Layers & Why Shapes Matter

    A neural-network layer, an attention score table and a batch of embeddings are all grids of numbers. Each grid turns vectors into vectors. Learn to multiply them by hand and to read shapes before your code crashes.

  3. Eigenvectors, SVD & Low-Rank Structure: PCA and LoRA

    Eigenvectors, the singular value decomposition, and low-rank approximation, worked by hand on small matrices. Then the two places AI uses them most. PCA finds the main axis of data. LoRA fine-tunes with a fraction of the parameters.

Calculus

  1. Derivatives: Slope, Rate of Change & the Functions ML Uses

    Slope, the limit of shrinking gaps, and tangent lines. Then the few rules that differentiate everything a network uses: squared error, sigmoid, ReLU, log loss. Read a derivative's sign to know which way to move, and check it numerically.

  2. Partial Derivatives & Gradients: Which Way Is Downhill?

    A loss with millions of weights is a landscape, and the gradient is the arrow that points uphill. Compute partial derivatives by hand and run three steps of gradient descent. See why a learning rate that is too large diverges.

  3. The Chain Rule & Backpropagation: How Gradients Flow Through a Network

    A network is a long chain of small functions. The chain rule traces the loss back to every weight. Work a complete backprop by hand on a tiny network. See why gradients vanish or explode, and what your framework does.

  4. Integrals: Accumulation, Area & the Continuous Side of Probability

    The last piece of calculus: integrals as accumulated area, and the fundamental theorem. Every density, expected value and softmax denominator is an integral. Includes a Monte Carlo estimate whose error shrinks like 1/√n.

Also in this repo

28 flashcards — four per lesson, in ai-math-foundations/review/.

A memory map — a 36-node JSON Canvas of how the seven lessons connect.

The math builds toward the statistics course. Its training lesson (Lesson 8) assumes gradients and backpropagation. Its lessons on continuous distributions and expectation use integrals.

See the README for how to use each.