(self, weight, bias, c, w0)
| 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) |