All problems
Quadratic Stability Upper Step
Problem
Gradient descent on f(x) = 0.5 * a * x^2 oscillates unless the learning rate satisfies 0 < lr < 2 / a.
Given the curvature a > 0, return the upper stability bound 2 / a.
Hint
The iterate multiplier is 1 - lr * a; keep its magnitude below one.
Test cases
case 1
in: [1]
expected: 2
case 2
in: [4]
expected: 0.5
case 3
in: [0.5]
expected: 4
Starter codePython
def quadratic_stability_upper_step(a):
# Your code here
pass3 test cases · run your code against them in the editor