Math for AI

Linear algebra, probability and calculus as actually used.

Math for AI is taught here in 12 lessons, running from Vectors and matrices for ML through to Reading machine learning papers. Each lesson takes one topic, shows the working code, and links onward to the next, so the course can be read straight through in order.

TrackAI & Intelligent Development
Lessons12
LevelBeginner to intermediate
Reading timeabout 3 hours
PrerequisitesHelpful, but not required: AI Agents

Lessons

  1. Vectors and matrices for MLThe two objects that every model is built from: vectors as features, matrices as batched linear maps, and the shape rules that decide whether your code runs.
  2. Probability and distributionsRandom variables, the distributions ML actually uses, and how cross-entropy is just negative log likelihood in disguise.
  3. Gradients and calculus intuitionDerivatives as sensitivity, the chain rule behind backpropagation, and how to tell a learning-rate problem from an architecture problem.
  4. Matrix decompositions and PCAEigenvalues, the SVD, low-rank approximation and principal component analysis derived from scratch rather than called as a black box.
  5. Multivariable calculus for trainingGradients, Jacobians and Hessians, the chain rule across layers, and what curvature tells you about why deep networks are hard to train.
  6. Optimisation and gradient descent variantsFrom batch descent to Adam, what momentum and adaptive scaling really change, how schedules help, and how to diagnose a diverging run.
  7. Information theory for machine learningEntropy, cross-entropy, KL divergence, mutual information and perplexity — what they measure and which loss to pick for which output.
  8. Statistical estimationMaximum likelihood and MAP, what makes an estimator good, the bias-variance decomposition, and interval estimates computed by bootstrap.
  9. Sampling and Monte Carlo methodsDrawing from distributions by inverse CDF and rejection, estimating expectations with importance sampling, and reducing variance with control variates.
  10. Linear and logistic regression from scratchDeriving the normal equations and gradient updates, implementing both models in NumPy, and verifying every implementation against scikit-learn.
  11. Numerical stability and floating pointOverflow, underflow and cancellation, the log-sum-exp trick, stable softmax and cross-entropy, and where float16 quietly loses accuracy.
  12. Reading machine learning papersNotation conventions, tensor shape bookkeeping, reading an ablation table critically, and reproducing a result from the maths alone.

More in AI & Intelligent Development

AI Basics AI Agents Machine Learning scikit-learn TensorFlow PyTorch Natural Language Processing LangChain Ollama OpenCV Codex Claude Code OpenCode Vibe Coding Selenium Playwright

FAQ

How long does the Math for AI course take?
It has 12 lessons, about 3 hours of reading. Expect roughly twice that if you type out and run every example.
Do I need prior experience for Math for AI?
Not strictly. It helps to have read AI Agents first, because some lessons build on it, but every lesson explains its own assumptions.
What should I read after Math for AI?
Continue with Machine Learning (13 lessons), the next course in AI & Intelligent Development.