MCPcopy Create free account
hub / github.com/ALRhub/X_IL / _init_weights

Method _init_weights

agents/backbones/encoder_decoder.py:90–97  ·  view source on GitHub ↗
(self, module)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected