(self, num_input_channels=3, mapping_size=256, scale=10)
| 60 | """ |
| 61 | |
| 62 | def __init__(self, num_input_channels=3, mapping_size=256, scale=10): |
| 63 | super().__init__() |
| 64 | |
| 65 | self._num_input_channels = num_input_channels |
| 66 | self._mapping_size = mapping_size |
| 67 | B = torch.randn((num_input_channels, mapping_size)) * scale |
| 68 | B_sort = sorted(B, key=lambda x: torch.norm(x, p=2)) |
| 69 | self._B = torch.stack(B_sort) # for sape |
| 70 | |
| 71 | def forward(self, x): |
| 72 | # assert x.dim() == 4, 'Expected 4D input (got {}D input)'.format(x.dim()) |