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

Method __init__

locationencoder/nn/siren.py:27–40  ·  view source on GitHub ↗
(self, dim_in, dim_out, w0 = 1., c = 6., is_first = False, use_bias = True, activation = None, dropout = False)

Source from the content-addressed store, hash-verified

25
26class Siren(nn.Module):
27 def __init__(self, dim_in, dim_out, w0 = 1., c = 6., is_first = False, use_bias = True, activation = None, dropout = False):
28 super().__init__()
29 self.dim_in = dim_in
30 self.is_first = is_first
31 self.dim_out = dim_out
32 self.dropout = dropout
33
34 weight = torch.zeros(dim_out, dim_in)
35 bias = torch.zeros(dim_out) if use_bias else None
36 self.init_(weight, bias, c = c, w0 = w0)
37
38 self.weight = nn.Parameter(weight)
39 self.bias = nn.Parameter(bias) if use_bias else None
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

Callers

nothing calls this directly

Calls 3

init_Method · 0.95
SineClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected