MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / init_method_normal

Method init_method_normal

tests/unit/megatron_model.py:88–94  ·  view source on GitHub ↗

Init method based on N(0, sigma).

(self, sigma)

Source from the content-addressed store, hash-verified

86 return attention_scores
87
88 def init_method_normal(self, sigma):
89 """Init method based on N(0, sigma)."""
90
91 def init_(tensor):
92 return torch.nn.init.normal_(tensor, mean=0.0, std=sigma)
93
94 return init_
95
96 def scaled_init_method_normal(self, sigma, num_layers):
97 """Init method based on N(0, sigma/sqrt(2*num_layers)."""

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected