All problems
Online Gradient Descent Regret Bound
Problem
Compute the standard online gradient descent regret bound.
Return D * G * sqrt(T) for a convex domain of diameter D, a gradient norm bound G, and T rounds. Return 0.0 when T < 1, D <= 0, or G <= 0.
Hint
The bound grows with the square root of the horizon.
Test cases
case 1
in: [1,2,100]
expected: 20
case 2
in: [0.5,1,10]
expected: 1.5811388300841898
case 3
in: [1,1,0]
expected: 0
case 4
in: [2,0,50]
expected: 0
Starter codePython
def ogd_regret_bound(D, G, T):
# Your code here
pass4 test cases · run your code against them in the editor