Skip to content
DeepForgeby svx
All problems

Dueling Aggregation Avg

Problem

Aggregate a dueling value and advantage stream using the average of the mean and max baselines.

baseline = (mean(advantage) + max(advantage)) / 2 and Q(a) = value + advantage[a] - baseline.

Hint

Averaging the two baselines is a middle ground between mean and max aggregation.

Test cases

case 1
in: [5,[1,2,3]]
expected: [3.5,4.5,5.5]
case 2
in: [0,[-1,0,1]]
expected: [-1.5,-0.5,0.5]
case 3
in: [2,[4,4]]
expected: [2,2]
Starter codePython
def dueling_aggregation_avg(value, advantage):
    # Your code here
    pass

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