All problems
Robbins Monro Stepsize
Problem
The Robbins-Monro schedule is lr_t = a / (t + b), which decays slowly enough to converge for stochastic approximation.
Given a, b, and the iteration index t (starting at 0), return the step size.
Hint
The offset b keeps the first steps finite.
Test cases
case 1
in: [1,1,0]
expected: 1
case 2
in: [2,10,5]
expected: 0.13333333333333333
case 3
in: [0.5,0.5,4]
expected: 0.1111111111111111
Starter codePython
def robbins_monro_stepsize(a, b, t):
# Your code here
pass3 test cases · run your code against them in the editor