(self, x, mods = None)
| 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 |
nothing calls this directly
no test coverage detected