MCPcopy Create free account
hub / github.com/UX-Decoder/Semantic-SAM / _init_weights

Method _init_weights

semantic_sam/backbone/swin.py:653–660  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

651 """
652
653 def _init_weights(m):
654 if isinstance(m, nn.Linear):
655 trunc_normal_(m.weight, std=0.02)
656 if isinstance(m, nn.Linear) and m.bias is not None:
657 nn.init.constant_(m.bias, 0)
658 elif isinstance(m, nn.LayerNorm):
659 nn.init.constant_(m.bias, 0)
660 nn.init.constant_(m.weight, 1.0)
661
662
663 def load_weights(self, pretrained_dict=None, pretrained_layers=[], verbose=True):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected