Orthogonal initialization (used in PPO and A2C)
(module: nn.Module, gain: float = 1)
| 241 | |
| 242 | @staticmethod |
| 243 | def init_weights(module: nn.Module, gain: float = 1) -> None: |
| 244 | """ |
| 245 | Orthogonal initialization (used in PPO and A2C) |
| 246 | """ |
| 247 | if isinstance(module, (nn.Linear, nn.Conv2d)): |
| 248 | nn.init.orthogonal_(module.weight, gain=gain) |
| 249 | if module.bias is not None: |
| 250 | module.bias.data.fill_(0.0) |
nothing calls this directly
no outgoing calls
no test coverage detected