Partial Derivatives

Derivatives when you have multiple inputs — like millions of weights

Why

A neural network has millions of parameters. The loss function depends on all of them simultaneously. A regular derivative only handles one variable. Partial Derivatives extend this: they let you ask "how does the loss change with respect to this one specific weight, while holding all others fixed?" This is exactly what backprop computes — a partial derivative for every single weight in the network.

Intuition

Imagine a landscape where your position is described by two coordinates (x, y) and your altitude is f(x, y). A partial derivative ∂f/∂x asks: if I take one step in the x-direction only (keeping y frozen), how much does my altitude change? ∂f/∂y asks the same for y.

In ML: x and y are two weights. f is the loss. Partial Derivatives tell you the slope in each weight's direction independently.

Explanation
How to compute a partial derivative

Treat all other variables as constants, then differentiate normally with respect to the target variable.

f(x, y) = 3x² + 2xy + y³ ∂f/∂x: treat y as constant → 6x + 2y ∂f/∂y: treat x as constant → 2x + 3y²

The notation ∂ (curly d) distinguishes partial from total derivatives. Read ∂f/∂wᵢ as "the partial derivative of f with respect to wᵢ."

Partial derivative of a loss function

In a simple linear model: ŷ = w·x + b, loss = MSE = (y - ŷ)²

L = (y - (wx + b))² ∂L/∂w = 2·(y - ŷ)·(-x) = -2x·(y - ŷ) ∂L/∂b = 2·(y - ŷ)·(-1) = -2·(y - ŷ)

These two partial derivatives tell you exactly how to update w and b to reduce the loss. This is the update rule for linear regression gradient descent.

In deep networks: ∂L/∂wᵢⱼ

A deep network has parameters w₁, w₂, ..., wₙ (millions of them). Backprop computes ∂L/∂wᵢ for every single weight. Each tells you: nudge this weight in this direction by this much to reduce the loss. The collection of all these partial derivatives is the gradient — covered next.