Skip to content
DeepForgeby svx
All problems

DQN Target Sync Counter

Problem

Decide whether the DQN target network should be synchronized at this step.

Return True when step is positive and divisible by sync_every, and False otherwise, including non-positive sync intervals.

Hint

Step 0 is the initial copy, not a hard sync.

Test cases

case 1
in: [100,100]
expected: true
case 2
in: [0,100]
expected: false
case 3
in: [250,100]
expected: false
case 4
in: [300,100]
expected: true
case 5
in: [7,1]
expected: true
Starter codePython
def should_sync_target(step, sync_every):
    # Your code here
    pass

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