lesson 2 of 5 · gradient descent by handlesson 2 of 5 · gradient descent by handlesson 2 of 5 · gradient descent by handlesson 2 of 5 · gradient descent by handlesson 2 of 5 · gradient descent by handlesson 2 of 5 · gradient descent by handlesson 2 of 5 · gradient descent by handlesson 2 of 5 · gradient descent by handlesson 2 of 5 · gradient descent by handlesson 2 of 5 · gradient descent by handlesson 2 of 5 · gradient descent by hand
Checkpoint
One last thing before we move on. pass this to mark the lesson done, or skip and keep moving. hop to the next when you're ready.
Automate the decade sweep. run(lr) descends f(w) = (w - 3)² from w=0 for 40 steps (gradient: 2*(w - 3)). For each lr in (0.001, 0.01, 0.1, 1.0) print f"lr={lr:<6} |w - 3| = {err:.6f}", then pick and print the best: f"best lr: {best}". Sweep in decades, read the errors, let the numbers choose.