MCPcopy Create free account
hub / github.com/geekcomputers/Python / __init__

Method __init__

ML/src/python/neuralforge/nn/modules.py:76–81  ·  view source on GitHub ↗
(self, normalized_shape, eps=1e-5)

Source from the content-addressed store, hash-verified

74
75class LayerNorm(nn.Module):
76 def __init__(self, normalized_shape, eps=1e-5):
77 super().__init__()
78 self.normalized_shape = normalized_shape
79 self.eps = eps
80 self.weight = nn.Parameter(torch.ones(normalized_shape))
81 self.bias = nn.Parameter(torch.zeros(normalized_shape))
82
83 def forward(self, x):
84 mean = x.mean(-1, keepdim=True)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected