Skip to content
nonconvexcard

Implement SGD and locate the noise floor

CodingAdvanced⏱ 3 hoursSGDsgdimplementationnoise floorschedules

Problem

Implement SGD on a strongly convex quadratic with an explicit Gaussian gradient oracle.

  1. Verify the two-phase behaviour: geometric decay followed by a plateau.
  2. Verify that the plateau height is proportional to ησ2/μ\eta\sigma^2/\mu by sweeping η\eta and σ\sigma.
  3. Compare constant, 1/t1/\sqrt t and 1/t1/t schedules; fit the asymptotic slopes.
  4. Add mini-batching and confirm the floor scales as 1/B1/B.

Implement it, then check the implementation against something you can verify independently.

Write it

Solve it here4 tests · Python runs in your browser
⌘/Ctrl + ↵ to run · limit 40s · draft saved in this browser
4 tests will run against your code. The first run downloads the Python runtime — several megabytes, once per browser.

Solution

Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.

Related problems

All problems
SolvedProblemFieldTypeDifficultyTime
Implement backpropagation from scratch runDeep LearningCodingIntermediate3 hours
Implement kernel ridge regression runClassical MLCodingIntermediate1 hour
Implement multi-head attention from scratch runDeep LearningCodingIntermediate3 hours
Implement power iteration and verify the convergence rate runFoundationsCodingIntermediate1 hour
Implement random projection and measure the distortion runHigh-Dim ProbabilityCodingIntermediate1 hour