Chapter 12 · overview · 1 min read
Math in AI
This last section puts the earlier ones to work. Each topic takes a real piece of machine learning, from a straight-line fit to the attention layer of a Transformer, and computes it by hand with small numbers, naming the maths you've already covered at every step. If you can follow these, you can read the equations in most machine-learning papers.
Topics in this section:
- Linear Regression End to End: fitting a line by formula and by gradient descent.
- Logistic Regression and the Sigmoid: turning a score into a probability for yes/no questions.
- A Forward Pass by Hand: a tiny neural network computed step by step.
- Backpropagation by Hand: the same network's gradients, and one learning step.
- Softmax and Cross-Entropy in Practice: many-class probabilities and their loss.
- Embeddings and Similarity Search: meaning as vectors, and finding neighbours.
- Attention as Dot Products: the core of the Transformer, in three lines.
- Bias, Variance and the Whole Picture: why models err, and how the pieces fit together.
Next comes Machine Learning and beyond, where these calculations are done at scale.