If y=f(g(x)), the chain rule gives: dxdy=dgdf⋅dxdg
Multivariable generalization: if y=f(g(x)) where f:Rm→Rk and g:Rn→Rm:
∂x∂y=∂g∂f⋅∂x∂g
This is a product of Jacobians: (k×m)⋅(m×n)=(k×n).
Why this is everything in deep learning:
- Backpropagation is the chain rule applied to a computation graph in reverse
- For L=loss(f3(f2(f1(x)))): ∂x∂L=∂f3∂L⋅∂f2∂f3⋅∂f1∂f2⋅∂x∂f1
- Each layer contributes one Jacobian factor; the backward pass accumulates them right-to-left
Concrete example: z=σ(Wx+b), L=∥z−y∥2
∂W∂L=∂z∂L⋅∂(Wx+b)∂z⋅∂W∂(Wx+b)
See also: Gradient, Backpropagation