(self, in_channels, out_channels, dim=5, share_nonlinearity=False, negative_slope=0.2)
| 79 | |
| 80 | class VNLinearLeakyReLU(nn.Module): |
| 81 | def __init__(self, in_channels, out_channels, dim=5, share_nonlinearity=False, negative_slope=0.2): |
| 82 | super(VNLinearLeakyReLU, self).__init__() |
| 83 | self.dim = dim |
| 84 | self.negative_slope = negative_slope |
| 85 | |
| 86 | self.map_to_feat = nn.Linear(in_channels, out_channels, bias=False) |
| 87 | self.batchnorm = VNBatchNorm(out_channels, dim=dim) |
| 88 | |
| 89 | if share_nonlinearity == True: |
| 90 | self.map_to_dir = nn.Linear(in_channels, 1, bias=False) |
| 91 | else: |
| 92 | self.map_to_dir = nn.Linear(in_channels, out_channels, bias=False) |
| 93 | |
| 94 | def forward(self, x): |
| 95 | ''' |
nothing calls this directly
no test coverage detected