A four-part series

Math for ML, by Hand

Linear algebra, calculus and probability for machine learning, worked on one model small enough to check with a pencil.

Pipeline of five boxes: input x, h equals A x, z equals w dot h plus b, p equals sigma of z, loss equals minus log of the probability given to the true label. Both example users get p = 0.5. Frame 1.
Five boxes: the whole model in this series
Pipeline of five boxes: input x, h equals A x, z equals w dot h plus b, p equals sigma of z, loss equals minus log of the probability given to the true label. Both example users get p = 0.5. Frame 2.
The user who clicked, x = (3, 4), gets p = 0.5
Pipeline of five boxes: input x, h equals A x, z equals w dot h plus b, p equals sigma of z, loss equals minus log of the probability given to the true label. Both example users get p = 0.5. Frame 3.
The user who did not, x′ = (1, 2), also gets p = 0.5. Training has to fix that

Two users, one 2×2 matrix and a sigmoid. The user who clicked is x = (3, 4); the one who did not is x′ = (1, 2). Both start at p = 0.5, and each part of the series explains one more box of the model until every number in it has been computed by hand.

Part 1: Why Is a Data Point an Arrow?

Math for ML, by Hand (part 1 of 4): vectors, length and angle, worked on one tiny model you can check with a pencil.

Part 2: What Does a Weight Matrix Actually Do to Your Data?

Math for ML, by Hand (part 2 of 4): linear maps, matrix products, determinants, eigenvectors and the SVD, on one 2×2 matrix.

Part 3: Why Does Gradient Descent Bounce?

Math for ML, by Hand (part 3 of 4): derivatives, integrals, gradients, the chain rule and the Hessian, on a model you can train with a pencil.

Part 4: Why Is Your Loss Function an Expected Value?

Math for ML, by Hand (part 4 of 4): probability, conditioning, expected value, the law of large numbers, entropy, cross-entropy and KL divergence.

The running cast

namevalue
x (clicked)(3, 4)
x′ (did not)(1, 2)
A[[2, 1], [1, 2]]
w, b(1, −1), 1
startz = 0, p = 0.5, loss 0.693 each