(self, obs, detach=False)
| 225 | |
| 226 | |
| 227 | def forward(self, obs, detach=False): |
| 228 | h = self.forward_conv(obs) |
| 229 | |
| 230 | if detach: |
| 231 | h = h.detach() |
| 232 | |
| 233 | try: |
| 234 | h_fc = self.fc(h) |
| 235 | except: |
| 236 | print(obs.shape) |
| 237 | print(h.shape) |
| 238 | assert False |
| 239 | self.outputs['fc'] = h_fc |
| 240 | |
| 241 | h_norm = self.ln(h_fc) |
| 242 | self.outputs['ln'] = h_norm |
| 243 | |
| 244 | if self.output_logits: |
| 245 | out = h_norm |
| 246 | else: |
| 247 | out = torch.tanh(h_norm) |
| 248 | self.outputs['tanh'] = out |
| 249 | |
| 250 | return out |
| 251 | |
| 252 | def copy_conv_weights_from(self, source): |
| 253 | """Tie convolutional layers""" |
nothing calls this directly
no test coverage detected