(self, input_dim, output_dim)
| 416 | """ |
| 417 | |
| 418 | def __init__(self, input_dim, output_dim): |
| 419 | super().__init__() |
| 420 | c, h, w = input_dim |
| 421 | |
| 422 | if h != 84: |
| 423 | raise ValueError(f"Expecting input height: 84, got: {h}") |
| 424 | if w != 84: |
| 425 | raise ValueError(f"Expecting input width: 84, got: {w}") |
| 426 | |
| 427 | self.online = self.__build_cnn(c, output_dim) |
| 428 | |
| 429 | self.target = self.__build_cnn(c, output_dim) |
| 430 | self.target.load_state_dict(self.online.state_dict()) |
| 431 | |
| 432 | # Q_target parameters are frozen. |
| 433 | for p in self.target.parameters(): |
| 434 | p.requires_grad = False |
| 435 | |
| 436 | def forward(self, input, model): |
| 437 | if model == "online": |
nothing calls this directly
no test coverage detected