x: point features of shape [B, N_feat, 3, N_samples, ...]
(self, x)
| 43 | self.negative_slope = negative_slope |
| 44 | |
| 45 | def forward(self, x): |
| 46 | ''' |
| 47 | x: point features of shape [B, N_feat, 3, N_samples, ...] |
| 48 | ''' |
| 49 | d = self.map_to_dir(x.transpose(1, -1)).transpose(1, -1) |
| 50 | dotprod = (x * d).sum(2, keepdim=True) |
| 51 | mask = (dotprod >= 0).float() |
| 52 | d_norm_sq = (d * d).sum(2, keepdim=True) |
| 53 | x_out = self.negative_slope * x + (1 - self.negative_slope) * ( |
| 54 | mask * x + (1 - mask) * (x - (dotprod / (d_norm_sq + EPS)) * d)) |
| 55 | return x_out |
| 56 | |
| 57 | |
| 58 | class VNNewLeakyReLU(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected