(self, in_channels, share_nonlinearity=False, negative_slope=0.2)
| 57 | |
| 58 | class VNNewLeakyReLU(nn.Module): |
| 59 | def __init__(self, in_channels, share_nonlinearity=False, negative_slope=0.2): |
| 60 | super(VNNewLeakyReLU, self).__init__() |
| 61 | if share_nonlinearity == True: |
| 62 | self.map_to_dir = nn.Linear(in_channels, 1, bias=False) |
| 63 | else: |
| 64 | self.map_to_dir = nn.Linear(in_channels, in_channels, bias=False) |
| 65 | self.negative_slope = negative_slope |
| 66 | |
| 67 | def forward(self, x): |
| 68 | ''' |