MCPcopy Create free account
hub / github.com/cswry/VOSR / _basic_init

Method _basic_init

models/lightningdit.py:429–433  ·  view source on GitHub ↗
(module)

Source from the content-addressed store, hash-verified

427 def initialize_weights(self):
428 # Initialize transformer layers:
429 def _basic_init(module):
430 if isinstance(module, nn.Linear):
431 torch.nn.init.xavier_uniform_(module.weight)
432 if module.bias is not None:
433 nn.init.constant_(module.bias, 0)
434 self.apply(_basic_init)
435
436 # Initialize (and freeze) pos_embed by sin-cos embedding:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected