(self, obs, detach=False)
| 87 | return conv |
| 88 | |
| 89 | def forward(self, obs, detach=False): |
| 90 | h = self.forward_conv(obs) |
| 91 | if detach: |
| 92 | h = h.detach() |
| 93 | |
| 94 | try: |
| 95 | h_fc = self.fc(h) |
| 96 | except: |
| 97 | print(obs.shape) |
| 98 | print(h.shape) |
| 99 | assert False |
| 100 | self.outputs['fc'] = h_fc |
| 101 | |
| 102 | h_norm = self.ln(h_fc) |
| 103 | self.outputs['ln'] = h_norm |
| 104 | |
| 105 | if self.output_logits: |
| 106 | out = h_norm |
| 107 | else: |
| 108 | out = torch.tanh(h_norm) |
| 109 | self.outputs['tanh'] = out |
| 110 | |
| 111 | return out |
| 112 | |
| 113 | def copy_conv_weights_from(self, source): |
| 114 | """Tie convolutional layers""" |
nothing calls this directly
no test coverage detected