Mathematics · core

Derivatives & Gradients

Partial derivatives, the gradient vector, and reading a loss surface for descent direction.

mathematicscalculus

Mental model

The gradient points uphill steepest. To minimize a loss, walk opposite the gradient. Each partial derivative tells you how sensitive the output is to one input — the chain rule chains these sensitivities through composed functions.

How to study Derivatives & Gradients

Begin by restating the mental model in your own words, then connect it to a concrete system you have built or operated. Name the mechanism, the constraint it addresses, and the trade-off it introduces. Use CS231n — Backpropagation & computational graphs, Neural Networks: Zero to Hero (Karpathy), Essence of Calculus (3Blue1Brown) to check details, but close the source before writing your explanation. Retrieval is the learning step; rereading is only preparation.

Next, compare Derivatives & Gradients with Multivariable Optimization, Gradient Descent, Backpropagation. Ask what changes in correctness, latency, resource use, operability, and failure recovery. Complete Compute a 2D gradient and preserve the command, input, output, and one failed attempt as evidence. Finish by explaining the idea without jargon to someone who has not studied the track.

Proof of understanding

  • Explain the mechanism from first principles and identify the state it reads or changes.
  • Give one situation where the concept is the right choice and one where it is not.
  • Predict a realistic failure mode before running the drill, then compare the prediction with evidence.
  • Connect the result to a roadmap or build artifact instead of treating the concept as isolated trivia.

Where it matters

Training neural nets, tuning hyperparameters, sensitivity analysis.

Common mistakes

  • Confusing gradient with the function value
  • Forgetting to zero-center data before interpreting partials
  • Using a fixed step size on a badly scaled surface

Learn from primary sources

Practice and explain it back

Compute a 2D gradient

f(x, y) = x² + 3xy + y². Compute ∇f at (1, 2). In which direction should you step to decrease f fastest, and what is the directional derivative in that direction?

Expected evidence: ∇f = [2x+3y, 3x+2y] → [8, 7] at (1,2). Steepest descent: −∇f/||∇f||. Directional derivative along −∇f/||∇f|| is −||∇f|| = −√113.

Open the interactive drill →

Review prompts

  • Why does gradient descent step opposite the gradient?

Build evidence

Use a roadmap capstone to turn this concept into working evidence.

Prerequisites

Related concepts

Learning paths