All problems
Sublinear Rate Value
Problem
Evaluate an O(1/T) sublinear convergence bound.
Return C / T, the optimization gap after T iterations of a subgradient-type method. Return 0.0 when T is not positive.
Hint
The bound improves linearly in the iteration count, hence the name 1/T rate.
Test cases
case 1
in: [10,2]
expected: 5
case 2
in: [1,100]
expected: 0.01
case 3
in: [7,1]
expected: 7
case 4
in: [5,0]
expected: 0
Starter codePython
def sublinear_rate_value(C, T):
# Your code here
pass4 test cases · run your code against them in the editor