(self, module)
| 88 | self.apply(self._init_weights) |
| 89 | |
| 90 | def _init_weights(self, module): |
| 91 | if isinstance(module, (nn.Linear, nn.Embedding)): |
| 92 | torch.nn.init.normal_(module.weight, mean=0.0, std=0.02) |
| 93 | if isinstance(module, nn.Linear) and module.bias is not None: |
| 94 | torch.nn.init.zeros_(module.bias) |
| 95 | elif isinstance(module, nn.LayerNorm): |
| 96 | torch.nn.init.zeros_(module.bias) |
| 97 | torch.nn.init.ones_(module.weight) |
| 98 | |
| 99 | def enc_only_forward(self, states, goals): |
| 100 | if len(states.size()) != 3: |
nothing calls this directly
no outgoing calls
no test coverage detected