Mathematics curriculum
Maths for AI
104 Jupyter notebooks across 14 modules — from linear algebra and calculus to information theory, statistical learning theory and the mathematics behind transformers, LoRA and diffusion — each with a from-scratch NumPy or PyTorch implementation.
- Deep learning foundations
- Optimisation
- Probability
- Transformers
- Status
- 104-notebook curriculum · CI-audited
- Started
- 2026
- Stack
- Jupyter · NumPy · PyTorch · SciPy · SymPy
- Notebooks
- 104
- Modules
- 14
- Learning tracks
- 6 role-based
- Quality
- Notebook audit + math regression in CI
Jump to section
Case-study brief
Verified 15 Sep 2026 (opens in a new tab)- Contribution
- Fourteen modules tiered from core to advanced, with six role-based tracks through them.
- Best evidence
- 104 notebooks · 14 modules
- Counted from numbered curriculum folders; excludes template and test-fixture notebooks.
- Main limitation
- Hour estimates per track are the author's estimates.
- Verification basis
- Recursive repository tree, curriculum docs, representative notebooks and CI tooling inspected.
Overview
A mathematics-first, implementation-driven curriculum for understanding modern AI/ML. Every notebook pairs a mathematical idea with a plot, a from-scratch NumPy or PyTorch implementation, and a direct connection to where that idea appears inside real ML and LLM systems.
Problem
Most machine-learning material either hand-waves the mathematics or presents it with no connection to the systems it explains. Understanding why LoRA works, why attention is scaled by √dₖ or why diffusion models are SDEs requires both.
Motivation
The curriculum makes the mapping explicit: eigen-decomposition and SVD to PCA and LoRA/QLoRA fine-tuning; softmax and the √dₖ scaling to transformer attention; stochastic processes and SDEs to diffusion models.
Architecture
Fourteen modules tiered from core to advanced, with six role-based tracks through them.
- Core
- Prerequisites, linear algebra, calculus, probability and statistics, optimisation.
- Important
- Information theory, numerical methods, capstone projects.
- Specialised
- Discrete mathematics, advanced linear algebra, advanced probability, statistical learning theory.
- Advanced
- Differential geometry and topology, functional analysis.
- Notebook template
- Objective → theory → visual intuition → implementation from scratch → why it matters for AI → graded exercises.
Implementation
- Notebooks on LoRA (a LoRALinear module wrapping a frozen linear layer), the neural tangent kernel and infinite-width networks, attention built from the mathematics, a mathematical analysis of GPT, KL divergence and the information bottleneck, diffusion mathematics, quantisation and mixed precision, scaling laws and double descent.
- Six tracks from AI/ML Beginner (26 notebooks) to Mathematical ML Researcher (all 104), plus fast paths such as “understand transformers” and “fine-tune LLMs with LoRA”.
- Tooling to execute and audit notebooks and to regression-test mathematical identities, run in CI.
Key technical decisions
01
Implementation-driven
Every idea is coded from scratch before a library is allowed to do it.
02
Rigor framework
A documented rigor and exercise framework governs how proofs, intuition and practice are balanced in each notebook.
Evaluation & results
- Coverage
- 104 notebooks · 14 modules
- Counted from the repository tree.
Challenges
- Keeping 104 executable notebooks green in CI as modules were added.
Limitations
- Hour estimates per track are the author's estimates.
What I learned
- The fastest way to understand a model is to implement the mathematics it rests on.
Links
- Repository (opens in a new tab)github.com/NiravRVaghasiya/maths-for-ai
- Learning paths (opens in a new tab)github.com/NiravRVaghasiya/maths-for-ai/blob/main/LEARNING_PATH.md
- Math → AI map (opens in a new tab)github.com/NiravRVaghasiya/maths-for-ai/blob/main/docs/MATH_TO_AI.md