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

Method _init_weights

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

Source from the content-addressed store, hash-verified

285 self.apply(self._init_weights)
286
287 def _init_weights(self, module):
288 if isinstance(module, (nn.Linear, nn.Embedding)):
289 torch.nn.init.normal_(module.weight, mean=0.0, std=0.02)
290 if isinstance(module, nn.Linear) and module.bias is not None:
291 torch.nn.init.zeros_(module.bias)
292 elif isinstance(module, nn.LayerNorm):
293 torch.nn.init.zeros_(module.bias)
294 torch.nn.init.ones_(module.weight)
295
296 def enc_only_forward(self, states, goals, sigma):
297

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected