Skip to content
DeepForgeby svx

Problem

Compute the replay ratio: gradient updates divided by environment steps. A non-positive step count returns 0.0.

Hint

A replay ratio of 1 means one gradient update per environment step.

Test cases

case 1
in: [100,25]
expected: 4
case 2
in: [1,4]
expected: 0.25
case 3
in: [0,10]
expected: 0
case 4
in: [7,0]
expected: 0
Starter codePython
def replay_ratio(gradient_steps, env_steps):
    # Your code here
    pass

4 test cases · run your code against them in the editor