(self, n_features)
| 63 | # We can then use this idea to implement a linear layer with symmetric weights |
| 64 | class LinearSymmetric(nn.Module): |
| 65 | def __init__(self, n_features): |
| 66 | super().__init__() |
| 67 | self.weight = nn.Parameter(torch.rand(n_features, n_features)) |
| 68 | |
| 69 | def forward(self, x): |
| 70 | A = symmetric(self.weight) |