(self, in_channels, dim=4, normalize_frame=False, share_nonlinearity=False, negative_slope=0.2)
| 187 | |
| 188 | class VNStdFeature(nn.Module): |
| 189 | def __init__(self, in_channels, dim=4, normalize_frame=False, share_nonlinearity=False, negative_slope=0.2): |
| 190 | super(VNStdFeature, self).__init__() |
| 191 | self.dim = dim |
| 192 | self.normalize_frame = normalize_frame |
| 193 | |
| 194 | self.vn1 = VNLinearLeakyReLU(in_channels, in_channels // 2, dim=dim, share_nonlinearity=share_nonlinearity, |
| 195 | negative_slope=negative_slope) |
| 196 | self.vn2 = VNLinearLeakyReLU(in_channels // 2, in_channels // 4, dim=dim, share_nonlinearity=share_nonlinearity, |
| 197 | negative_slope=negative_slope) |
| 198 | if normalize_frame: |
| 199 | self.vn_lin = nn.Linear(in_channels // 4, 2, bias=False) |
| 200 | else: |
| 201 | self.vn_lin = nn.Linear(in_channels // 4, 3, bias=False) |
| 202 | |
| 203 | def forward(self, x): |
| 204 | ''' |
nothing calls this directly
no test coverage detected