Yifang-Qin/DisenPOI

The distance decay is applied twice?

Closed this issue · 2 comments

Thank you for making the code public and for your awesome work on the WSDM'23 paper.

After running the code for the public dataset, I have a small concern about the Distance kernel $w(d_{ij}) := \exp(-d^2_{ij})$. Here is the input of the Geo GCN:

DisenPOI/LBS.py

Lines 101 to 105 in 04d190e

dist_weight = torch.exp(-(self.dist_vec ** 2))
for i in range(self.gcn_num):
geo_feat = self.geo_conv[i](geo_feat, self.edge_index, self.adj_weight, dist_weight)
geo_feat = F.leaky_relu(geo_feat)
geo_feat = F.normalize(geo_feat, dim=-1)

Here is the forward implementation of Geo GCN:

DisenPOI/LBS.py

Lines 153 to 166 in 04d190e

def forward(self, x, edge_index, adj_weight, dist_vec):
row, col = edge_index
deg = degree(col, x.size(0), dtype=x.dtype)
deg_inv_sqrt = deg.pow(-0.5)
deg_inv_sqrt[deg_inv_sqrt == float('inf')] = 0
norm = deg_inv_sqrt[row] * deg_inv_sqrt[col]
dist_weight = torch.exp(-(dist_vec ** 2))
dist_adj = torch.sparse_coo_tensor(edge_index, dist_weight * norm)
side_embed = torch.sparse.mm(dist_adj, x)
bi_embed = torch.mul(x, side_embed)
return self.W0(side_embed) + self.W1(bi_embed)

So, I am concerned that the decay (-dist_vec ** 2) is applied twice (in L.101 for the first time and L.160 for the second time). I'm sorry if I misunderstood the implementation, and I am happy to discuss the implementation details if possible.

@cocomoff Thanks for your interest in our work. As you mentioned, there is indeed a problem with the repeated calculation of dist_weight in the code. This should be due to mixing different versions of module code when releasing the public version. We appreciate you pointing out the issues in the code, and the LBS.py file has now been updated to fix the issue.

@Yifang-Qin Thank you for your quick response and great work! :)