MCPcopy Create free account
hub / github.com/LTH14/mar / _basic_init

Method _basic_init

models/diffloss.py:195–199  ·  view source on GitHub ↗
(module)

Source from the content-addressed store, hash-verified

193
194 def initialize_weights(self):
195 def _basic_init(module):
196 if isinstance(module, nn.Linear):
197 torch.nn.init.xavier_uniform_(module.weight)
198 if module.bias is not None:
199 nn.init.constant_(module.bias, 0)
200 self.apply(_basic_init)
201
202 # Initialize timestep embedding MLP

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected