ML Foundations

Learn / ML Foundations

ML Foundations: Advanced Optimization and Convexity

Advanced quiz on Hessians, curvature, convexity, momentum, Newton's method, conditioning, and finite-difference intuition.

Learning path

0%

0 of 4 sections marked complete · about 31 minutes

Learning objectives

What you will be able to explain

  • What information does the Hessian capture?
  • Compute a gradient and Hessian
  • What Hessian condition characterizes a twice-differentiable convex function?
  • Take one Newton step
  • Compute one momentum update
  • Match each optimizer to its key idea

Section 01

What information does the Hessian capture? to What Hessian condition characterizes a twice-differentiable convex function?

01

What information does the Hessian capture?

The Hessian contains second derivatives and describes how curvature changes across directions. This is what makes second-order methods different from plain gradient descent.

Guided checkpoint

Choose the best description.

02

Compute a gradient and Hessian

The gradient is (2x+y,x+4y)(2x + y, x + 4y), which becomes (1,3)(1, -3) at (1,1)(1, -1). The Hessian is constant: [2114]\begin{bmatrix} 2 & 1 \\ 1 & 4 \end{bmatrix}.

Guided checkpoint

Let f(x,y)=x2+xy+2y2f(x, y) = x^2 + xy + 2y^2. Compute the gradient at (1,1)(1, -1) and the distinct Hessian entries.

03

What Hessian condition characterizes a twice-differentiable convex function?

For twice-differentiable functions, positive semidefinite curvature everywhere is the standard convexity test. This links optimization geometry directly to linear algebra.

Guided checkpoint

Choose the standard criterion.

Section 02

Take one Newton step to Match each optimizer to its key idea

01

Take one Newton step

Newton's update is wt+1=wtf(wt)/f(wt)w_{t+1} = w_t - f'(w_t) / f''(w_t). Here f(w)=2w6f'(w) = 2w - 6 and f(w)=2f''(w) = 2, so w1=0(6)/2=3w_1 = 0 - (-6)/2 = 3.

Guided checkpoint

Use Newton's method on f(w)=w26wf(w) = w^2 - 6w starting from w0=0w_0 = 0. Compute w1w_1.

02

Compute one momentum update

The new velocity is 0.90.2+4=4.180.9 \cdot 0.2 + 4 = 4.18. The parameter update is then 10.14.18=0.5821 - 0.1 \cdot 4.18 = 0.582.

Guided checkpoint

Use the update vt+1=βvt+gtv_{t+1} = \beta v_t + g_t and wt+1=wtηvt+1w_{t+1} = w_t - \eta v_{t+1}. Let vt=0.2v_t = 0.2, gt=4g_t = 4, β=0.9\beta = 0.9, η=0.1\eta = 0.1, and wt=1w_t = 1. Compute vt+1v_{t+1} and wt+1w_{t+1}.

03

Match each optimizer to its key idea

These methods differ mainly in how they use gradient information and whether they account for noise, momentum, curvature, or parameter-wise scaling.

Guided checkpoint

Match the method to the most characteristic property.

Section 03

Optimization facts: true or false to Approximate a derivative by finite differences

01

Optimization facts: true or false

Curvature classifies stationary points locally, convexity constrains global structure, and Adam is specifically designed to adapt updates across parameters and time.

Guided checkpoint

Mark each statement as true or false.

02

What is a saddle point?

At a saddle point, different directions have different curvature behavior. This is one reason high-dimensional optimization landscapes can be tricky even when the gradient is small.

Guided checkpoint

Choose the best description.

03

Approximate a derivative by finite differences

We compute f(3.1)=9.61f(3.1) = 9.61 and f(3)=9f(3) = 9, so the approximation is (9.619)/0.1=6.1(9.61 - 9)/0.1 = 6.1. The exact derivative would be 2w=62w = 6 at w=3w = 3.

Guided checkpoint

Use the forward difference approximation f(w+h)f(w)h\frac{f(w+h) - f(w)}{h} for f(w)=w2f(w) = w^2 at w=3w = 3 with h=0.1h = 0.1.

Section 04

Why can plain gradient descent zig-zag in narrow valleys?

01

Why can plain gradient descent zig-zag in narrow valleys?

When one direction is much steeper than another, a fixed learning rate can overreact in one coordinate and underreact in another. That is a hallmark of ill-conditioned optimization problems.

Guided checkpoint

Choose the best explanation.

Knowledge check

Turn understanding into recall.

The quiz now follows the same concepts in scored form. You can return to this lesson from the quiz whenever a gap appears.