(self, in_features, out_features, std=1.)
| 421 | |
| 422 | class FourierFeatures(nn.Module): |
| 423 | def __init__(self, in_features, out_features, std=1.): |
| 424 | super().__init__() |
| 425 | assert out_features % 2 == 0 |
| 426 | self.register_buffer('weight', torch.randn([out_features // 2, in_features]) * std) |
| 427 | |
| 428 | def forward(self, input): |
| 429 | f = 2 * math.pi * input @ self.weight.T |