DPVO
DPVO copied to clipboard
The code correspondence of the paper formula 5?
I checked the source code and I want to know:
How is this reflected in the code? I can't find it.
I found the code:
class SoftAgg(nn.Module):
def __init__(self, dim=512, expand=True):
super(SoftAgg, self).__init__()
self.dim = dim
self.expand = expand
self.f = nn.Linear(self.dim, self.dim)
self.g = nn.Linear(self.dim, self.dim)
self.h = nn.Linear(self.dim, self.dim)
def forward(self, x, ix):
_, jx = torch.unique(ix, return_inverse=True)
w = torch_scatter.scatter_softmax(self.g(x), jx, dim=1)
y = torch_scatter.scatter_sum(self.f(x) * w, jx, dim=1)
if self.expand:
return self.h(y)[:,jx]
return self.h(y)
And for:
net = net + self.agg_ij(net, ii*12345 + jj)
Why 12345?