Calculus
Derivatives: The Mathematics of Change
The question calculus answers
"If I nudge the input a tiny bit, how much does the output change?"
That single question is the derivative, and it is the engine of all deep learning. Here's why it matters: a model has parameters (those 's). Training asks, over and over: if I nudge this weight up a little, does my error go down? The derivative answers instantly, for millions of weights at once.
From slope to derivative
For a straight line , the slope is always 3: increase by 1 and rises by 3, everywhere.
Curves are trickier — the steepness of keeps changing. The trick: zoom in. Any smooth curve looks straight under enough magnification. The slope of that local straight line is the derivative at that point, written or .
For , the derivative is :
- At : slope (climbing steeply)
- At : slope (flat — the bottom of the valley!)
- At : slope (descending steeply)
Slope zero marks the bottom. Remember that; it is the entire premise of model training: we search for the flat spot at the bottom of the error curve.
The rules (you need surprisingly few)
| Rule | Statement | Example |
|---|---|---|
| Power | ||
| Constant multiple | ||
| Sum | derivatives add up | |
| Exponential | (its own slope!) | |
| Logarithm | shows up in log-loss |
In practice, deep learning frameworks (PyTorch, TensorFlow) compute all derivatives automatically — it's called autodiff. You will rarely differentiate by hand. But you must understand what the numbers mean: a derivative is a sensitivity dial — how much does the output care about this input?
Minima: where learning stops
Training wants to minimize error. At a minimum the derivative is zero — the curve is flat. So a naive recipe for learning is:
- Compute the derivative of the error with respect to each parameter.
- If the derivative is positive, the error increases with the parameter → decrease the parameter. If negative → increase it.
- Repeat until every derivative is (near) zero.
That recipe has a name — gradient descent — and after one more concept (gradients) you'll fully understand it.
Key takeaways
- Derivative = local slope = "how sensitive is the output to this input?"
- Slope zero ⇒ flat ⇒ possible minimum: exactly what training searches for.
- Frameworks differentiate for you (autodiff); your job is interpreting the result.
Check your understanding
1.The derivative of at is…
2.At the bottom of a valley in the loss curve, the derivative is…
3.In deep learning frameworks, derivatives are computed…
0% of Mathematics for AI completed