MCPcopy Create free account
hub / github.com/THUDM/GLM / init_method_normal

Function init_method_normal

model/modeling_glm.py:27–37  ·  view source on GitHub ↗

Init method based on normal distribution. This is only used for embeddings. The transformer has its own initializer.

(std=0.02)

Source from the content-addressed store, hash-verified

25
26
27def init_method_normal(std=0.02):
28 """Init method based on normal distribution.
29
30 This is only used for embeddings. The transformer has its
31 own initializer.
32 """
33
34 def init_(tensor):
35 return torch.nn.init.normal_(tensor, mean=0.0, std=std)
36
37 return init_
38
39
40class GLMModel(torch.nn.Module):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected