Gradients of Vector-Valued Functions
Vector Calculus
When f : mathbb{R}^n to mathbb{R}^m maps vectors to vectors, the analog of the gradient is a matrix called the Jacobian, J_f = frac{partial f}{partial mathbf{x}} in mathbb{R}^{m times n}. Its (i,j) entry is frac{partial f_i}{partial x_j} โ the sensitivity of the i-th output component to the j-th inp
The Jacobian collects all partial derivatives of a vector-valued map.
When maps vectors to vectors, the analog of the gradient is a matrix called the Jacobian, . Its entry is โ the sensitivity of the -th output component to the -th input. Row is the gradient of transposed.
The Jacobian is the best linear approximation of near a point: . This extends the 1D idea to arbitrary input/output dimensions. It's why we call 'locally linear' and why gradient-based methods work โ the nonlinear function behaves like a matrix at each point.
The chain rule generalizes elegantly to Jacobians. If and , then โ just multiply Jacobians in order. This is the mathematical backbone of backpropagation: each layer contributes one Jacobian factor, and the chain rule stitches them together.
For linear functions , the Jacobian is simply โ the linear approximation is exact. For element-wise nonlinearities like applied to a vector, the Jacobian is . These two cases, combined via chain rule, give you the Jacobian of any feedforward network.
In ML, the Jacobian drives backpropagation (chaining layer-by-layer Jacobians), adversarial attacks (linearizing a classifier via its input Jacobian), neural ODE solvers (integrating flow Jacobians for invertibility), and normalizing flows (tracking for density estimation). Working comfortably with Jacobians is the bridge from scalar calculus to the matrix calculus that dominates modern deep learning.
Worked example โ Jacobian of $f(x,y) = (xy,\; x+y,\; x^2)$: The map goes , so is . Taking partials row by row: . At this is โ the dimensions check out ( rows of outputs, columns of inputs).
Exercises
Put your understanding to the test. Score + streak + speed all count.
Confirm you've got it
3 quick questions. Get 2 right to mark this lesson complete.