TL;DR

  1. Gradient = vector of partial derivatives; points in the direction of steepest ascent. At a minimum of a differentiable function: .
  2. Two gradients to know by heart: and .
  3. Gradient descent: . SGD uses the gradient of one random data point.
  4. Convex: every local minimum is global. -strongly convex: curved at least like , unique minimizer. -Lipschitz: (slope at most ). -smooth: the gradient is -Lipschitz.
  5. Logs: , , ; is AdaBoost’s vote.

Derivatives and the chain rule

for (not differentiable at 0)
(ReLU, hinge)0 for , 1 for

Chain rule: . Example: .

Minimizing a one-dimensional function

: . The "" (a ridge penalty) pulls the minimizer from 3 towards 0.

Gradients

Gradient

For : . It points in the direction of steepest increase; is the direction of steepest descent.

Gradients used in the course

  • .
  • .
  • .
  • for symmetric .

Setting gives the normal equations . For ridge, gives (L5).

Gradient descent and SGD

Update rules

  • GD: with step size (learning rate) .
  • SGD: pick a random data point and use instead of the full gradient.
  • Least squares: .

Where it appears: the perceptron is SGD on the linear loss (L2); stability of GD and SGD (L4); implicit regularization of GD (L8).

Memory aid

β€œWalk downhill”: minus the gradient, times a step size. Too large a step overshoots ( can diverge), too small is slow.

Convexity, Lipschitz, smoothness

Convex

is convex if the line between two points of its graph lies above the graph: for . Equivalent for twice differentiable : (Hessian PSD). Every local minimum is a global minimum.

Examples: , , , hinge , logistic are convex; the 0-1 loss is not, which is why surrogate losses are used.

Strongly convex, Lipschitz, smooth

  • -strongly convex: is still convex; the function curves up at least like a parabola with curvature . Example: is -strongly convex. Consequence: a unique minimizer.
  • -Lipschitz: ; for differentiable the same as . Example: hinge and logistic loss are 1-Lipschitz in the score, the squared loss is not (on an unbounded domain).
  • -smooth: the gradient is -Lipschitz, : no sharp kinks.

Where it appears: stability of ERM with strongly convex losses and of regularized ERM (L4, L5); Lipschitz constant as robustness measure (L8).

Memory aid

Lipschitz = speed limit (the function cannot change faster than ). Strongly convex = bowl (the minimum is sharp and unique, so one changed data point moves it only a little: stability). Smooth = no kinks (the slope changes slowly, so gradient steps are safe).

Logs and exponentials

Rules

, , , , , . Useful values: , , , . . Solving : .

AdaBoost's vote

: for : ; : (a coin flip gets no vote); : . Weight update: , so a misclassified point is multiplied by when (L6).

argmin, sup, inf

  • is the smallest value, the point where it is attained. ERM: .
  • (supremum) is the smallest upper bound, like a maximum that need not be attained (). likewise for lower bounds. The Bayes risk ; uniform convergence looks at , the worst function in the class.

Memory aid

A over a class means β€œthe worst case in the class”: if even the worst function has a small gap between training and true risk, then so does the one ERM picks.

Self-check