University calculus · University

Gradient

∇f = (∂f/∂x; ∂f/∂y)

The idea

The gradient is an arrow that points where the hill is steepest upward.

The board

  1. ∇f = (∂f∂x; ∂f∂y) — a vector of partial derivatives.
  2. f = x2 + y2: ∇f = (2x; 2y). At (1; 2) → (2; 4).
  3. It points in the direction of fastest increase; its length is the steepness.
  4. Artificial intelligence “learns” by walking against the gradient — down the hill of the error.

The most common mistake

Thinking the gradient is a number. It's a vector — it has a direction.

The trick

On a topographic map the gradient is perpendicular to the contour lines.

Problems

∇(x² + y²) at (3; 1)?

  • (6; 2)
  • 10
  • (3; 1)
  • (9; 1)
Show the answer

(6; 2) — (2x; 2y).

Gradient descent goes…

  • perpendicular
  • against the gradient
  • randomly
  • along the gradient
Show the answer

against the gradient — Down toward the minimum.

Take the lesson · exercises and XPFree, no sign-up needed.

You need to know

Leads to