dacbench.wrappers.reward_noise_wrapper
Module Contents
Classes
Wrapper to add noise to the reward signal. |
- class dacbench.wrappers.reward_noise_wrapper.RewardNoiseWrapper(env, noise_function=None, noise_dist='standard_normal', dist_args=None)
Bases:
gym.WrapperWrapper to add noise to the reward signal. Noise can be sampled from a custom distribution or any distribution in numpy’s random module
- __setattr__(self, name, value)
Set attribute in wrapper if available and in env if not
- Parameters
name (str) – Attribute to set
value – Value to set attribute to
- __getattribute__(self, name)
Get attribute value of wrapper if available and of env if not
- Parameters
name (str) – Attribute to get
- Returns
Value of given name
- Return type
value
- step(self, action)
Execute environment step and add noise
- Parameters
action (int) – action to execute
- Returns
state, reward, done, metainfo
- Return type
np.array, float, bool, dict
- add_noise(self, dist, args)
Make noise function from distribution name and arguments
- Parameters
dist (str) – Name of distribution
args (list) – List of distribution arguments
- Returns
Noise sampling function
- Return type
function