MCPcopy Create free account
hub / github.com/TEA-Lab/TwoByTwo / forward

Method forward

src/shape_assembly/models/encoder/vn_layers.py:45–55  ·  view source on GitHub ↗

x: point features of shape [B, N_feat, 3, N_samples, ...]

(self, x)

Source from the content-addressed store, hash-verified

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
58class VNNewLeakyReLU(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected