Home / Maths for AI / Symbols / Calculus

Partial derivative

Say it: "partial f, partial x", "del f del x"

What it means

The derivative of a function of several variables with respect to one of them, holding the others fixed.

Example

f(x,y)=x2y  ⇒  ∂f∂x=2xy,∂f∂y=x2f(x, y) = x^2 y \;\Rightarrow\; \frac{\partial f}{\partial x} = 2xy, \quad \frac{\partial f}{\partial y} = x^2

Treat the other variable as a number.

In code

f = lambda x, y: x ** 2 * y
h = 1e-6
print(round((f(3 + h, 2) - f(3, 2)) / h, 3), "= 2*3*2")

Output

12.0 = 2*3*2

Where it appears in machine learning

∂L∂w\frac{\partial L}{\partial w}: how much the loss changes when one weight changes. Backpropagation computes it for every weight.

Related symbols

Learn it properly in the free lesson Gradients, with practice questions that check your answers.