Skip to content
DeepForgeby svx
All problems

TD3 Policy Smoothing

Problem

Average two smoothed TD3 target actions for variance reduction.

Clip each noise to [-clip_range, clip_range], add it to the action, clamp the result to [low, high], and return the mean of the two smoothed actions.

Hint

Averaging two smoothed targets further reduces the variance of the critic target.

Test cases

case 1
in: [0.5,0.2,-0.1,0.15,-1,1]
expected: 0.525
case 2
in: [0.95,0.5,0.5,0.2,-1,1]
expected: 1
case 3
in: [-0.9,-0.5,0.5,0.2,-1,1]
expected: -0.85
Starter codePython
def td3_policy_smoothing(action, noise1, noise2, clip_range, low, high):
    # Your code here
    pass

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