Mathematics for Deep Learning

Throughout the main chapters of this book, we introduce mathematical tools just in time—stating each result alongside its geometric, statistical, or physical intuition so that you can build and train working models without losing momentum. Yet anyone who wants to move beyond applying existing recipes to diagnosing subtle training failures, reading frontier research papers critically, or inventing new methods eventually needs to look inside the mathematical engine. Why does the learning rate of gradient descent have a hard ceiling set by the largest eigenvalue of the Hessian? Why does minimizing cross-entropy estimate the true conditional distribution, and why does the Jensen–Shannon divergence saturate when two distributions fail to overlap? How does adding Gaussian noise to an image day by day define a reverse-time differential equation that turns pure noise back into a photograph?

This six-chapter appendix answers those questions in full. It is designed to serve two complementary purposes:

Just like the rest of the book, every section in this appendix pairs its mathematical derivations with runnable code and computational experiments (implemented in PyTorch, JAX, TensorFlow, and MXNet), turning abstract theorems into concrete numerical phenomena that you can inspect, plot, and test for yourself: