Rosetta Stone · 6 of 30
Gradient operator (nabla, del)
Operator: it does something
In plain English
Collect every partial derivative into one vector. is the list . That vector points in the direction in which increases fastest, and its length says how steep that direction is. Gradient descent steps the opposite way, . The subscript says which variables you are differentiating with respect to.
As code
// numeric gradient of f over a parameter vector
function grad(f, theta, h = 1e-6) {
return theta.map((_, j) => {
const up = theta.slice(); up[j] += h;
return (f(up) - f(theta)) / h; // ∂f/∂θ_j
});
}Where the analogy bends: Illustrative only. Autodiff computes the same vector exactly and far faster.
See it
What it means, field by field
Gradient of the loss with respect to parameters; the input to every optimiser (SGD, Adam).
Force as the negative gradient of potential energy, F = −∇U; ∇· (divergence) and ∇× (curl) in electromagnetism.
Chemotaxis: cells move up or down chemical concentration gradients, a physical gradient they sense locally.
In a research paper
New parameters = old parameters minus a small step (η) in the direction of steepest loss increase, i.e. a step downhill.
Common misreadings
Confusing ∇ (nabla) with Δ (delta). ∇ produces a vector of slopes; Δ usually means a difference or change.
Thinking the gradient points to the minimum. It points uphill locally; the minimum may be far away and in another direction.
Assuming "gradient" in biology (a concentration gradient) and in ML are the same mechanism. They share the mathematics of slopes, not the process.