algorithms.util.action_perturbator.EpsilonActionPerturbator

class algorithms.util.action_perturbator.EpsilonActionPerturbator(noise: float)[source]

Bases: ActionPerturbator

Implements a simple ε noise.

__init__(noise: float)[source]

Methods

__init__(noise)

perturb(action[, clip])

Add a noise to the proposed action.

perturb(action, clip=True)[source]

Add a noise to the proposed action.

Parameters:
  • action (np.ndarray) – A 1D vector of values representing the action.

  • clip – Controls whether to clip the noised values in [0,1].

Returns:

A vector of noised values, with the same shape as action.

Return type:

np.ndarray