What is it?
: the derivative with respect to one variable, holding the others fixed. Each answers "how sensitive is the output to this input?" — for a neural network, to this weight.
Why does it exist?
With many inputs, "the" rate of change depends on the direction you move. The simplest directions are the axes: move one variable, freeze the rest. Partial derivatives are those axis-aligned rates, and (for nice functions) they determine the rate in every other direction.
Intuition
Slice the surface with the plane : you get a curve, and is its slope. Slice with for . On a mountain: is how steep it is walking due east, due north.
Formal definition
where is the -th unit vector. If all partials exist and are continuous near (), is differentiable at ; if , mixed partials commute: (Schwarz).
Formulas
How is it computed?
Differentiate in treating every other variable as a constant; all single-variable rules apply.
Example
Squared error of a linear model with two weights: . Then and . The common factor is the "error signal" that backpropagation sends to every weight.
Why does it matter?
Training computes for every parameter ; image processing computes and to find edges; physics writes its laws (heat, waves, fluids, electromagnetism, quantum mechanics) as equations between partial derivatives.
Where it shows up in computing
Edge detection estimates and of the intensity.
The heat equation is a relation between partial derivatives.
Where it shows up in AI
Backprop computes for every weight of the network.
Where is it used?
Computing topics reachable from here, through the chain of ideas that leads to them:
3D Computer graphics
- Gradient→Surface normals★★★★★
- Gradient→Signed distance fields and ray marching★★★★★
- Gradient→Surface normals→Lighting and shading★★★★★
- Gradient→Surface normals→Ray tracing★★★★★
- Divergence→Laplacian→Mesh processing (discrete differential geometry)★★★★★
- Gradient→Surface normals→Ray tracing→The rendering equation★★★★★
⚙ Robotics and control
- Multivariable chain rule→Jacobian matrix→Robot Jacobian (velocity kinematics)★★★★★
- Multivariable chain rule→Jacobian matrix→Inverse kinematics★★★★★
- Gradient→Constrained optimization→Trajectory optimization and MPC★★★★★
- Multivariable chain rule→Jacobian matrix→Equilibria and stability→Control theory★★★★★
- Total differential and linearization→Kalman filter★★★★★
⚛ Physics and simulation
- Heat equation and diffusion★★★★★
- Partial differential equations→Wave equation★★★★★
- Divergence→Electromagnetism (Maxwell's equations)★★★★★
- Divergence→Fluid dynamics and CFD★★★★★
- Partial differential equations→Finite element method★★★★★
- Divergence→Fluid dynamics and CFD→Weather and climate modelling★★★★★
- +4
What depends on it
Exercises
Compute all first and second partial derivatives of and check that .
Solution
, , , , .
For and , show that .
Solution
, , . The product simplifies to : sigmoid and cross-entropy cancel beautifully.