MCPcopy Create free account
hub / github.com/KohakuBlueleaf/HyperKohaku / basic_init

Method basic_init

modules/hypernet.py:67–71  ·  view source on GitHub ↗
(module)

Source from the content-addressed store, hash-verified

65
66 def init_weights(self, add_constant: bool = False):
67 def basic_init(module):
68 if isinstance(module, nn.Linear):
69 nn.init.xavier_uniform_(module.weight)
70 if module.bias is not None:
71 nn.init.constant_(module.bias, 0)
72 self.apply(basic_init)
73
74 # For no pre-optimized training, you should consider use the following init

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected