Maths tutorials and worked examples
Understand the geometry, calculus and numerical methods behind machine learning through worked calculations.
Linear algebra
Trace matrices, dimensions and linear maps.
Matrix multiplication with shapes: map a batch of vectors
Trace a 2×3 batch through a 3×2 matrix, calculate individual entries and distinguish matrix multiplication from broadcasting and elementwise products.
tutorial · 4 min read
Derivatives and gradients
Derive model gradients and check them numerically.
Derivatives for machine learning: check a squared-error gradient
Derive the weight and bias gradients of a linear model, verify dimensions and compare central differences with the analytic result.
tutorial · 4 min read
Optimization
Connect update rules, curvature and convergence.
Gradient descent learning rates: convergence, oscillation and divergence
Run three learning rates on an explicit quadratic, derive the stability boundary and compare reproducible objective curves.
tutorial · 4 min read
Vectors and geometry
Use geometric interpretations to choose and check similarity measures.
Cosine similarity vs Euclidean distance: choose what closeness means
Calculate both measures on the same vectors, explain their different rankings, and connect normalized distance to cosine similarity.
comparison · 4 min read
Numerical methods
Evaluate mathematical expressions reliably in finite precision.
Log-sum-exp: calculate model scores without exponential overflow
Derive the maximum-shift identity, reproduce overflow and verify stable log-sum-exp and softmax calculations in Python.
tutorial · 4 min read
Maths for machine learning
Connect prerequisites to the model calculations they explain.
Prerequisites for machine learning and AI: the maths, statistics and Python you need
Machine learning and AI prerequisites: the Python, maths and statistics you need, what deep learning and LLMs add, and a checklist to test whether you are ready.
learning path · 9 min read