Skip to content
DeepForgeby svx
All problems

Delayed Policy Update Counter

Problem

Return how many policy updates are now due under delayed policy updates: step // delay minus updates_done, floored at 0. A non-positive delay returns 0.

Hint

TD3 updates the actor and target networks less often than the critic.

Test cases

case 1
in: [10,2,3]
expected: 2
case 2
in: [10,2,5]
expected: 0
case 3
in: [1,2,0]
expected: 0
case 4
in: [8,0,0]
expected: 0
Starter codePython
def delayed_policy_updates(step, delay, updates_done):
    # Your code here
    pass

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