Skip to content
DeepForgeby svx
All problems

Action Space Noise

Problem

Add noise to an action for exploration and clip the result to the valid range [low, high].

Hint

Clipping keeps the noisy action inside the environment's action bounds.

Test cases

case 1
in: [0.5,0.2,-1,1]
expected: 0.7
case 2
in: [0.9,0.5,-1,1]
expected: 1
case 3
in: [-0.9,-0.5,-1,1]
expected: -1
Starter codePython
def action_space_noise(action, noise, low, high):
    # Your code here
    pass

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