Skip to content

lit_sb3.algorithms.ars.policies

source module lit_sb3.algorithms.ars.policies

Classes

source class ARSPolicy(observation_space: spaces.Space, action_space: spaces.Space, net_arch: list[int] | None = None, activation_fn: type[nn.Module] = nn.ReLU, with_bias: bool = True, squash_output: bool = True)

Bases : BasePolicy

Policy network for ARS.

Parameters

  • observation_space : spaces.Space — The observation space of the environment

  • action_space : spaces.Space — The action space of the environment

  • net_arch : list[int] | None — Network architecture, defaults to a 2 layers MLP with 64 hidden nodes.

  • activation_fn : type[nn.Module] — Activation function

  • with_bias : bool — If set to False, the layers will not learn an additive bias

  • squash_output : bool — For continuous actions, whether the output is squashed or not using a tanh() function. If not squashed with tanh the output will instead be clipped.

Attributes

  • device : torch.device — Infer which device this policy lives on by inspecting its parameters.

  • squash_output : bool — (bool) Getter for squash_output.

Methods

source method ARSPolicy.forward(obs: PyTorchObs) → torch.Tensor

Raises

  • NotImplementedError

source class ARSLinearPolicy(observation_space: spaces.Space, action_space: spaces.Space, with_bias: bool = False, squash_output: bool = False)

Bases : ARSPolicy

Linear policy network for ARS.

Parameters

  • observation_space : spaces.Space — The observation space of the environment

  • action_space : spaces.Space — The action space of the environment

  • with_bias : bool — With or without bias on the output

  • squash_output : bool — For continuous actions, whether the output is squashed or not using a tanh() function. If not squashed with tanh the output will instead be clipped.

Attributes

  • device : torch.device — Infer which device this policy lives on by inspecting its parameters.

  • squash_output : bool — (bool) Getter for squash_output.