Checkpoint
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
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.