(self, birdview, state)
| 72 | nn.init.constant_(m.bias, 0.1) |
| 73 | |
| 74 | def forward(self, birdview, state): |
| 75 | cnn_feature = [] |
| 76 | feature = birdview |
| 77 | for i in range(len(self.cnn)): |
| 78 | feature = self.relu(self.cnn[i](feature)) |
| 79 | if birdview.shape[0] == 1: |
| 80 | cnn_feature.append(feature[0, ...].detach().cpu().numpy()) |
| 81 | #cnn_feature = self.cnn(birdview) |
| 82 | x = feature.flatten(start_dim=1) |
| 83 | latent_state = self.state_linear(state) |
| 84 | |
| 85 | # latent_state = state.repeat(1, state.shape[1]*256) |
| 86 | |
| 87 | x = th.cat((x, latent_state), dim=1) |
| 88 | x = self.linear(x) |
| 89 | return x, cnn_feature |
| 90 | |
| 91 | |
| 92 | class ImpalaCNN(nn.Module): |
no test coverage detected