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

Method forward

locationencoder/nn/siren.py:85–99  ·  view source on GitHub ↗
(self, x, mods = None)

Source from the content-addressed store, hash-verified

83 self.last_layer = Siren(dim_in = dim_hidden, dim_out = dim_out, w0 = w0, use_bias = use_bias, activation = final_activation, dropout = False)
84
85 def forward(self, x, mods = None):
86
87 # do some normalization to bring degrees in a -pi to pi range
88 if self.degreeinput:
89 x = torch.deg2rad(x) - torch.pi
90
91 mods = cast_tuple(mods, self.num_layers)
92
93 for layer, mod in zip(self.layers, mods):
94 x = layer(x)
95
96 if exists(mod):
97 x *= rearrange(mod, 'd -> () d')
98
99 return self.last_layer(x)
100
101# modulatory feed forward
102

Callers

nothing calls this directly

Calls 2

cast_tupleFunction · 0.85
existsFunction · 0.85

Tested by

no test coverage detected