Skip to content
DeepForgeby svx
All problems

Double DQN Target

Problem

Compute the Double DQN bootstrap target.

If the episode is done, return reward. Otherwise select the greedy next action using online_next (smallest index on ties) and return reward + gamma * target_next[that action].

Hint

The online network picks the action; the target network supplies the value.

Test cases

case 1
in: [1,false,0.9,[1,3,2],[5,1,2]]
expected: 1.9
case 2
in: [2,true,0.9,[1,2],[3,4]]
expected: 2
case 3
in: [0,false,1,[2,2,1],[1,9,5]]
expected: 1
case 4
in: [-1,false,0.5,[0,0],[-2,-4]]
expected: -2
Starter codePython
def double_dqn_target(reward, done, gamma, online_next, target_next):
    # Your code here
    pass

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