The maths behind machine learning.
Software practitioners comfortable with code, no university maths assumed.

Course progress
51 of 180
lessons published, one connected step at a time.
- Next
- Lesson 52: Least squares is a projection problem
- Modules
- 12, from notation to support vector machines
Twelve modules, in order
1
Mathematical Foundations
Notation, functions, sets, sums, logs and reading a derivation.
10 of 10 published
- 1Variables, values, and AI models
- 2Functions as reusable mathematical machines
- 3Domain, codomain, and valid model inputs
- 4Sets, membership, and datasets
- 5Indices, subscripts, and tensor addresses
- 6Sums, products, and loss aggregation
- 7Powers, roots, and model scaling
- 8Logarithms turn products into sums
- 9Equations, constraints, and solution sets
- 10Reading a derivation line by line
2
Linear Algebra
Systems of equations, vectors, matrices, spaces and maps.
28 of 28 published
- 11One linear equation as a geometric line
- 12Systems of equations as intersections
- 13No solution, one solution, or many solutions
- 14Vectors as representations of AI data
- 15Vector addition combines signals
- 16Scalar multiplication controls strength
- 17Linear combinations build new vectors
- 18Matrices organize linear rules
- 19Matrix-vector products as weighted sums
- 20Matrix-matrix products compose transformations and batches
- 21Transpose reorients relationships
- 22Identity and inverse transformations
- 23Gaussian elimination preserves the solution set
- 24Row-echelon form reveals structure
- 25Numerical solving without explicit inverses
- 26Why algebraic structures determine valid operations
- 27Vector spaces define legal representations
- 28Subspaces capture restricted feature families
- 29Linear independence removes redundancy
- 30Span describes what a representation can express
- 31Bases give compact coordinate systems
- 32Dimension counts independent directions
- 33Rank measures effective linear information
- 34Linear mappings preserve combinations
- 35Matrices represent linear mappings
- 36Kernel and image explain lost and reachable information
- 37Affine spaces add offsets to linear structure
- 38Linear algebra in a tiny neural network
3
Analytic Geometry
Norms, inner products, angles, orthogonality and projection.
13 of 16 published
- 39Norms measure vector size
- 40L1, L2, and L-infinity see size differently
- 41Inner products measure alignment
- 42Dot products turn features into scores
- 43Distance depends on the chosen geometry
- 44Angles and cosine similarity
- 45Orthogonality means no linear overlap
- 46Orthonormal bases simplify coordinates
- 47Gram–Schmidt builds orthogonal directions
- 48Orthogonal complements capture what is left
- 49Functions can have inner products too
- 50Projection finds the nearest point
- 51Projection matrices transform whole datasets
3 upcoming
- 52Least squares is a projection problem
- 53Rotations preserve length and angle
- 54Geometry of similarity search
4
Matrix Decompositions
Determinants, eigenvalues, Cholesky and the SVD.
0 of 18 published
Starts at lesson 55.
18 upcoming
- 55Determinants measure oriented volume
- 56Singular matrices collapse information
- 57Trace summarizes diagonal action
- 58Eigenvectors keep their direction
- 59Eigenvalues measure directional growth
- 60Characteristic polynomials find eigenvalues
- 61Eigenvectors in Markov and ranking systems
- 62Cholesky factorization exploits positive definiteness
- 63Diagonalization decouples a transformation
- 64Symmetric matrices have friendly eigenstructure
- 65Singular value decomposition factorizes any matrix
- 66Singular values rank directions by strength
- 67Pseudoinverses solve nonsquare systems
- 68Low-rank approximation keeps the strongest patterns
- 69Matrix compression for model weights
- 70Conditioning predicts numerical sensitivity
- 71NumPy factorizations and reconstruction checks
- 72How decompositions power modern AI systems
5
Vector Calculus
Derivatives, gradients, the chain rule and backpropagation.
0 of 26 published
Starts at lesson 73.
26 upcoming
- 73Change, slopes, and local predictions
- 74Limits make instantaneous change precise
- 75Derivative rules avoid repeating limits
- 76The chain rule traces composed change
- 77Derivatives of common activation functions
- 78Partial derivatives hold other inputs fixed
- 79Gradients collect steepest local change
- 80Directional derivatives query any direction
- 81Jacobians map vector-to-vector sensitivity
- 82The Jacobian chain rule composes layers
- 83Matrix gradients track every parameter
- 84Trace tricks simplify matrix derivatives
- 85Computation graphs make dependencies visible
- 86Forward-mode automatic differentiation propagates tangents
- 87Reverse-mode automatic differentiation propagates adjoints
- 88Backpropagation through a dense layer
- 89Gradient checking catches derivative bugs
- 90PyTorch autograd records the graph
- 91Hessians measure multivariate curvature
- 92Second derivatives classify critical points
- 93Linearization approximates a model locally
- 94Taylor series add curvature information
- 95Vanishing gradients from repeated chain rules
- 96Exploding gradients and stability controls
- 97Attention gradients connect token influence
- 98The calculus of a tiny training step
6
Probability & Distributions
Random variables, Bayes, Gaussians and expectations.
0 of 28 published
Starts at lesson 99.
28 upcoming
- 99Uncertainty needs a mathematical language
- 100Sample spaces, events, and outcomes
- 101Probability axioms constrain valid assignments
- 102Conditional probability updates the reference set
- 103Random variables map outcomes to numbers
- 104Discrete distributions assign probability mass
- 105Continuous distributions use density, not point mass
- 106Cumulative distributions answer threshold questions
- 107Sum and product rules build and reduce joint probabilities
- 108Bayes' theorem reverses a condition
- 109Base rates change what a model alert means
- 110Expectation is a probability-weighted average
- 111Variance measures spread around expectation
- 112Covariance tracks joint movement
- 113Covariance matrices summarize many features
- 114Independence is stronger than zero covariance
- 115Empirical estimates learn statistics from samples
- 116Gaussian distributions link location and scale
- 117Standardization creates comparable coordinates
- 118Multivariate Gaussians shape uncertainty with covariance
- 119Gaussian conditionals and marginals
- 120Sampling correlated Gaussians with Cholesky
- 121Exponential families share a common form
- 122Conjugate priors make Bayesian updates tractable
- 123Maximum likelihood connects observed data to parameters
- 124Change of variables transforms densities
- 125Inverse-transform sampling turns uniform noise into data
- 126Probability in a classifier pipeline
7
Continuous Optimization
Gradient descent, constraints and convexity.
0 of 16 published
Starts at lesson 127.
16 upcoming
- 127Objective functions turn learning into search
- 128Gradient descent follows local downhill information
- 129Learning rates control step size
- 130Loss landscapes contain valleys, plateaus, and saddles
- 131Stochastic gradients trade noise for speed
- 132Momentum accumulates a velocity
- 133Adaptive optimizers rescale coordinate updates
- 134Constrained optimization separates goals and rules
- 135Lagrange multipliers balance objective and constraint
- 136Regularization can act like a soft constraint
- 137Convex sets contain the lines between points
- 138Convex functions have no bad local minima
- 139Convexity gives optimization certificates
- 140Optimization in PyTorch without a black box
- 141Debugging training with mathematical signals
- 142Design an optimizer for a toy model
8
Models & Data
Data, models, learning and evaluation.
0 of 9 published
Starts at lesson 143.
9 upcoming
- 143Data, models, and learning rules play different roles
- 144Supervised learning approximates an unknown map
- 145Empirical risk turns examples into an objective
- 146Loss functions encode which errors matter
- 147Parameter estimation connects probability and optimization
- 148Probabilistic modeling specifies a generative story
- 149Inference asks about hidden quantities
- 150Directed graphs encode conditional structure
- 151Model selection balances fit and complexity
9
Linear Regression
Least squares, MLE, MAP and Bayesian regression.
0 of 8 published
Starts at lesson 152.
8 upcoming
- 152Linear regression maps features to numeric targets
- 153Least-squares estimation from projection geometry
- 154Maximum likelihood explains squared error under Gaussian noise
- 155Regularized regression controls unstable weights
- 156Bayesian linear regression puts a distribution on weights
- 157Posterior predictive uncertainty varies by input
- 158Linear regression implementation and diagnostics
- 159When a linear model is the right baseline
10
Principal Component Analysis
Dimensionality reduction by projection.
0 of 8 published
Starts at lesson 160.
8 upcoming
- 160Dimensionality reduction preserves selected structure
- 161PCA finds directions of maximum variance
- 162PCA is also a minimum-error projection
- 163SVD computes PCA without forming covariance
- 164PCA in high-dimensional AI data
- 165Practical PCA: centering, scaling, and component choice
- 166Probabilistic PCA introduces latent variables
- 167PCA for embedding inspection, with caveats
11
Gaussian Mixture Models
Density estimation with EM.
0 of 6 published
Starts at lesson 168.
6 upcoming
- 168Mixtures model data with multiple overlapping groups
- 169Latent assignments turn mixtures into a hidden-variable model
- 170Mixture likelihood couples unknown parameters
- 171Expectation–maximization alternates inference and fitting
- 172Implement a GMM and watch EM converge
- 173GMM failure modes and model selection
12
Support Vector Machines
Margins, duality and kernels.
0 of 7 published
Starts at lesson 174.
7 upcoming
- 174Hyperplanes turn dot products into decision boundaries
- 175Margin measures classification robustness
- 176The primal SVM balances margin and classification errors
- 177The dual SVM centers training examples
- 178Kernels create nonlinear boundaries through inner products
- 179Train and diagnose an SVM
- 180From mathematical foundations to ML models
Applied notes
The same maths, put to work on current AI.
From vectors to embeddings: the geometry behind similarity
Build an intuitive understanding of vectors, dot products, cosine similarity, and why embeddings turn meaning into geometry.
AlphaEvolve Lowered the Matrix Multiplication Exponent—Not Your GPU Bill
AlphaEvolve helped lower the best matrix multiplication exponent bound. Learn what changed, how it was certified, and why it will not speed up today’s GPUs.
Cross-Model KV Cache Transfer Is Fast—and Surprisingly Pair-Specific
NVIDIA researchers report a 25× component speedup for one KV-cache mapping, while several other model pairs lost much of the target model’s task accuracy.
Temperature Scaling and ECE: Calibrate Model Confidence Step by Step
Work through softmax, fit a temperature on six predictions, compute ECE, and see why a better likelihood can still produce a worse binned calibration score.
ROC-AUC at 0.97, Precision at 9%: The Base-Rate Math
Work through a 1%-positive detector, turn thresholds into ROC and precision-recall points, and choose an operating point for a 30-alert review budget.
Where this came from
The lessons follow the dependency order of Deisenroth, Faisal and Ong’s Mathematics for Machine Learning, with original bridges, visuals and labs, and every lesson ends with worked questions you can check step by step. They were first published on Beyond the Hype, where new lessons still appear first.