Foundations
Maths toolkit
The maths the rest of the book uses: vectors, matrices, derivatives, integrals and probability. Explained with pictures, not proofs.
Start course 17 lessons · 5 levels
Level 1·Warm-up
Level 2·Linear algebra
- Vectors: lists of numbersA vector is a list of numbers, and the dot product measures how much two vectors point the same way.
- Matrices: tables of numbersA matrix is a table of numbers, and multiplying it by a vector does many dot products at once.
- Matrices as transformations: determinants and inversesA matrix moves the plane, its determinant measures how area scales, and its inverse moves everything back.
- Directions that only stretch: eigenvectors and eigenvaluesMost arrows turn under a matrix, but a few directions only stretch, and they decide what repeating it does.
Level 3·Calculus
- How things change: derivativesA derivative is the slope of a curve up close. Its sign tells you which way to nudge the input.
- Many knobs: partial derivatives and the gradientWith many inputs, wiggle one at a time to get each slope. Together they make the gradient, which points uphill.
- Chains of functions: the chain ruleWhen functions feed into each other, their slopes multiply. This one rule computes every gradient a neural network needs.
- Zooming in: linear and quadratic approximation (Taylor)Close to any point, a smooth curve looks like a straight line, and a little further out like a parabola.
- Adding up the continuous: integralsAn integral adds up a rate over time, which you can see as the area under its curve.
Level 4·Probability and information
- Chance: probability and distributionsA probability says how often something happens. A distribution lists the probability of every outcome.
- Averages you can trust: expectation, variance and learning from samplesThe expected value is the long-run average. You can learn it from samples by nudging a guess toward each one.
- Continuous chance: densities and the normal distributionWhen an outcome can be any number, probability lives in areas under a curve. Averaging samples estimates any expected value.
- Memoryless randomness: Markov chainsA Markov chain moves at random between states, and the next step depends only on where you are now.
- Scores to probabilities: argmax, softmax and log-probabilitiesSoftmax turns any list of scores into probabilities, and temperature sets how decisive it is.
- Surprise: entropy, cross-entropy and KL divergenceSurprise, entropy, cross-entropy and KL divergence: how to score a model's probabilities against what really happens.