The Matrix Calculus You Need For Deep Learning
matrix-calculusdeep-learningbackpropagationgradientjacobian
Abstraction: Matrix calculus tutorial covering gradients and Jacobians for neural network training
Key points:
- Covers partial derivatives, gradients, and the Jacobian matrix as the core tools; Jacobian is m-by-n matrix of all partial derivatives of m functions w.r.t. n parameters
- Introduces three chain rule variants: single-variable, single-variable total-derivative, and vector chain rule; the vector chain rule (Jacobian product) is the general form subsumes the others
- Element-wise operations produce diagonal Jacobians under the "element-wise diagonal condition," simplifying computations substantially
- Derives gradient of neuron activation (dot product + ReLU) w.r.t. weights w and bias b; shows gradient is error-weighted average of inputs across training examples
- Gradient descent update rule subtracts scaled gradient to minimize mean-squared-error loss; same formulation underlies backpropagation in PyTorch and similar libraries
- Authors: Terence Parr (Google/USF) and Jeremy Howard (fast.ai); arxiv preprint 1802.01528
Connections: Jeremy Howard · Fast AI · Pytorch · Matrix Calculus · Backpropagation · Gradient Descent