ActionNoise

class fluidgym.wrappers.action_noise.ActionNoise(env: FluidEnvLike, sigma: float, seed: int)[source]

Bases: FluidWrapper

A wrapper that adds Gaussian noise to the actions.

It adds Gaussian noise with standard deviation sigma to the actions.

Parameters:
  • env (FluidEnvLike) – The environment to wrap.

  • sigma (float) – The standard deviation of the Gaussian noise.

  • seed (int) – The random seed for the noise generator.

step(action: Tensor) tuple[dict[str, Tensor], Tensor, bool, bool, 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 call reset() 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.