ActionNoise
- class fluidgym.wrappers.action_noise.ActionNoise(env: FluidEnvLike, sigma: float, seed: int)[source]
Bases:
FluidWrapperA wrapper that adds Gaussian noise to the actions.
It adds Gaussian noise with standard deviation sigma to the actions and clips the noisy actions to the action space bounds, since the environment rejects actions outside of them.
- Parameters:
- step(action: Tensor) tuple[dict[str, Tensor], Tensor, bool | Tensor, bool | Tensor, dict[str, Tensor]][source]
Run one timestep of the environment’s dynamics using the agent actions.
When the end of an episode is reached (
terminated or truncated), it is necessary to callreset()to reset this environment’s state for the next episode.- Parameters:
action (torch.Tensor) – The action to take.
- Returns:
tuple[
dict[str, torch.Tensor], torch.Tensor, bool, bool, dict[str, torch.Tensor]] – A tuple containing the observation, reward, terminated flag, truncated flag, and info dictionary.