MCPcopy Create free account
hub / github.com/MarcCoru/locationencoder / init_

Method init_

locationencoder/nn/siren.py:42–49  ·  view source on GitHub ↗
(self, weight, bias, c, w0)

Source from the content-addressed store, hash-verified

40 self.activation = Sine(w0) if activation is None else activation
41
42 def init_(self, weight, bias, c, w0):
43 dim = self.dim_in
44
45 w_std = (1 / dim) if self.is_first else (math.sqrt(c / dim) / w0)
46 weight.uniform_(-w_std, w_std)
47
48 if exists(bias):
49 bias.uniform_(-w_std, w_std)
50
51 def forward(self, x):
52 out = F.linear(x, self.weight, self.bias)

Callers 1

__init__Method · 0.95

Calls 1

existsFunction · 0.85

Tested by

no test coverage detected