Mathematics for ML
Mathematical foundations for the rest of the curriculum. The goal is enough fluency to understand optimization, probability, embeddings, attention, and evaluation without treating them as magic.
This phase is a support layer for the rest of the repo, not a requirement to master every theorem before moving forward. Use it to build enough intuition and fluency to stop later AI topics from feeling opaque.
Folder Map
| Folder | Notebooks | Level | What It Covers |
|---|---|---|---|
| foundational/ | 13 | Beginner | Core math: linear algebra, calculus, probability, gradient descent, info theory, neural net math |
| 3blue1brown/ | 42 | Beginner | Visual intuition: calculus (12), linear algebra (13), differential equations (8), neural networks (9) |
| mml-book/ | 24 | Intermediate | Mathematics for Machine Learning: course (10), exercises (4), practice labs (10) |
| cs229-course/ | 18 | Intermediate | Stanford CS229: regression, classification, SVMs, learning theory, clustering, RL |
| islp-book/ | 15 | Intermediate | Intro to Statistical Learning: 13 chapters + practice exercises |
| mlpp-book/ | 13 | Intermediate | ML: A Probabilistic Perspective: Bayesian inference, graphical models, MCMC, EM |
| dli-book/ | 6 | Intermediate | Deep Learning Interviews: practice labs for logistic regression, info theory, CNNs |
| slp-book/ | 6 | Intermediate | Speech & Language Processing: NLP labs from tokenization to transformers |
| advanced/ | 16 | Advanced | Research topics: learning theory, PAC-Bayes, NTK, variational inference, state space models |
| ml-problem/ | - | Reference | ML problem-solving reference PDF |
Total: 153 notebooks across 10 folders
Quick Start
# Start here
jupyter notebook foundational/01_linear_algebra_fundamentals.ipynbLearning Paths
Path 1: Beginner (start here)
Work through the foundational notebooks first. These cover the essentials:
- foundational/01 - Linear Algebra
- foundational/02 - Calculus
- foundational/03 - Probability
- foundational/04 - Gradient Descent
- foundational/05 - Information Theory
- foundational/06 - Statistical Inference
- foundational/07 - Neural Network Math
Supplement with 3blue1brown/ notebooks for visual intuition on any topic that feels abstract.
Path 2: ML Engineer
After the foundational pass, build depth in ML theory and algorithms:
- mml-book/course/ - rigorous math foundations (linear algebra through optimization)
- cs229-course/ - Stanford ML algorithms (regression, SVMs, neural nets, RL)
- mml-book/practice-labs/ - hands-on implementation of MML concepts
- dli-book/ - deep learning interview math
Path 3: Data Scientist
Statistical and probabilistic foundations:
- islp-book/ - statistical learning (regression, classification, resampling, trees, SVMs)
- mlpp-book/ - probabilistic perspective (Bayesian inference, graphical models, MCMC)
- slp-book/ - NLP and language model foundations
Path 4: Researcher
Graduate-level theory (requires Path 1 + Path 2 as prerequisites):
- advanced/ - learning theory, concentration inequalities, PAC-Bayes, NTK
- foundational/08 - Advanced Linear Algebra
- foundational/12 - Optimization from Scratch
Topic Cross-Reference
Find the same topic at different depths across folders:
| Topic | Beginner | Intermediate | Advanced | Practice |
|---|---|---|---|---|
| Linear Algebra | foundational/01, 3b1b/linear-algebra/ | mml-book/01 | foundational/08 | mml-labs/01 |
| Calculus | foundational/02, 3b1b/calculus/ | mml-book/04 | - | mml-labs/04 |
| Probability | foundational/03 | mml-book/05, mlpp/01 | - | mml-labs/05, dli/04 |
| Optimization | foundational/04 | mml-book/06, cs229/02 | advanced/09 | mml-labs/06 |
| Information Theory | foundational/05 | - | - | dli/02 |
| Regression | - | mml-book/07, cs229/01, islp/03 | - | mml-labs/07 |
| Classification | - | cs229/04, islp/04 | - | dli/01 |
| SVMs | - | mml-book/10, cs229/06, islp/09 | - | mml-labs/10 |
| PCA | - | mml-book/08, cs229/14 | - | mml-labs/08 |
| Neural Networks | foundational/07, 3b1b/neural-networks/ | cs229/10-11, islp/10 | - | slp/04 |
| Transformers/LLMs | - | - | - | slp/05-06 |
| Bayesian Methods | - | mlpp/04, mml-book/07 | advanced/07 | dli/04 |
| Clustering/GMM | - | mml-book/09, cs229/13, mlpp/11 | - | mml-labs/09 |
Source PDFs
Each book folder contains its own PDF:
| Location | |
|---|---|
| Mathematics for Machine Learning | mml-book/mml-book.pdf |
| Stanford CS229 Notes | cs229-course/cs229.pdf |
| Intro to Statistical Learning with Python | islp-book/ISLP.pdf |
| ML: A Probabilistic Perspective | mlpp-book/ML-Machine-Learning-A-Probabilistic-Perspective.pdf |
| Deep Learning Interviews | dli-book/2201.00650v2.pdf |
| Speech & Language Processing | slp-book/ed3book_jan26.pdf |
| ML Problem Solving | ml-problem/ml-problem.pdf |
Practical Rules
- Learn the intuition before the notation
- Re-derive small examples by hand when possible
- If a symbol-heavy notebook feels abstract, reconnect it to one use case: gradient descent, cosine similarity, cross-entropy, PCA, or attention
- Do not try to finish every notebook before continuing the curriculum
- Do not spend weeks on theorem-level depth if your goal is applied AI engineering
How To Use This Phase Well
- Do one foundational pass first instead of hopping randomly across all ten folders.
- Use this phase just-in-time when later modules expose a math gap you can name.
- Prefer targeted reinforcement over exhaustive completion when your main goal is building systems.
- Return for deeper theory only after you have a concrete reason, such as optimization confusion, evaluation errors, or model architecture questions.
What Comes Next
After the foundational notebooks, continue into:
- 04-token/README.md if you want to connect math intuition to language-model preprocessing.
- 05-embeddings/README.md if you want the fastest payoff from vector geometry and similarity concepts.
- 06-neural-networks/README.md if you want gradient-based modeling and deep learning context.
Then come back here as needed instead of treating this folder as a prerequisite gate.