ray.rllib.models.torch.torch_modelv2.TorchModelV2.__init__#

TorchModelV2.__init__(obs_space: gymnasium.spaces.Space, action_space: gymnasium.spaces.Space, num_outputs: int, model_config: dict, name: str)[source]#

Initialize a TorchModelV2.

Here is an example implementation for a subclass MyModelClass(TorchModelV2, nn.Module):

def __init__(self, *args, **kwargs):
    TorchModelV2.__init__(self, *args, **kwargs)
    nn.Module.__init__(self)
    self._hidden_layers = nn.Sequential(...)
    self._logits = ...
    self._value_branch = ...