def __init__(self, representation_dim: int, action_dim: int, action_bound: Optional[float], hidden_dimensions: List[int], nonlinearity: str, layernorm: bool, log_param_min: float, log_param_max: float):
    super().__init__()
    self.state_dim = representation_dim
    self.action_dim = action_dim
    self.action_bound = action_bound
    self.log_param_min = log_param_min
    self.log_param_max = log_param_max
    assert hidden_dimensions, "Hidden dimensions can't be empty."
    self.hidden_dimensions = hidden_dimensions
    self.hidden_layers = len(hidden_dimensions)
    activation: Callable[(..., nn.Module)] = _map_nonlinearities(nonlinearity)
    self.layernorm = layernorm
    layers = [nn.Linear(self.state_dim, hidden_dimensions[0]), activation(inplace=True)]
    if layernorm:
        layers.append(nn.LayerNorm(normalized_shape=hidden_dimensions[0]))
    if (1 < self.hidden_layers):
        for (i, hidden_dim) in enumerate(hidden_dimensions[:(- 1)]):
            hid = [nn.Linear(hidden_dim, hidden_dimensions[(i + 1)]), activation(inplace=True)]
            if layernorm:
                hid.append(nn.LayerNorm(normalized_shape=hidden_dimensions[(i + 1)]))
            layers.extend(hid)
    self.trunk = nn.Sequential(*layers)
    self.value_head = nn.Linear(hidden_dimensions[(- 1)], 1)
def __init__(self, representation_dim: int, action_dim: int, action_bound: Optional[float], hidden_dimensions: List[int], nonlinearity: str, layernorm: bool, log_param_min: float, log_param_max: float):
    super().__init__()
    self.state_dim = representation_dim
    self.action_dim = action_dim
    self.action_bound = action_bound
    self.log_param_min = log_param_min
    self.log_param_max = log_param_max
    assert hidden_dimensions, "Hidden dimensions can't be empty."
    self.hidden_dimensions = hidden_dimensions
    self.hidden_layers = len(hidden_dimensions)
    activation: Callable[(..., nn.Module)] = _map_nonlinearities(nonlinearity)
    self.layernorm = layernorm
    layers = [nn.Linear(self.state_dim, hidden_dimensions[0]), activation(inplace=True)]
    if layernorm:
        layers.append(nn.LayerNorm(normalized_shape=hidden_dimensions[0]))
    if (1 < self.hidden_layers):
        for (i, hidden_dim) in enumerate(hidden_dimensions[:(- 1)]):
            hid = [nn.Linear(hidden_dim, hidden_dimensions[(i + 1)]), activation(inplace=True)]
            if layernorm:
                hid.append(nn.LayerNorm(normalized_shape=hidden_dimensions[(i + 1)]))
            layers.extend(hid)
    self.trunk = nn.Sequential(*layers)
    self.value_head = nn.Linear(hidden_dimensions[(- 1)], 1)