CoLA icon indicating copy to clipboard operation
CoLA copied to clipboard

Construction of positive and negative instance pairs.

Open rvbugs0 opened this issue 2 years ago • 2 comments

After carefully reviewing the code, I understand that the subgraphs produced by the random walk with restart algorithm during the training phase can be referred to as positive pairs, with the target node serving as the node for which the given subgraph or trace was produced. However, I'm not sure how exactly we're creating negative pairs.

rvbugs0 avatar Jan 03 '23 13:01 rvbugs0

Negative instance pairs are created in the discriminator during this code segment, which performs an edge cutting operation. After obtaining the negative instance pairs, the model calculates scores through its computation. for _ in range(self.negsamp_round): c_mi = torch.cat((c_mi[-2:-1,:], c_mi[:-1,:]),0) scs.append(self.f_k(h_pl, c_mi))

suziyou12 avatar Jul 17 '23 05:07 suziyou12

The code generating negative pairs isc_mi = torch.cat((c_mi[-2:-1,:], c_mi[:-1,:]),0). It seems that the approach is to generate negative samples by circularly shifting the global feature. But I wonder why the choice is c_mi[-2:-1,:] to shift the second-to-last row rather than the last row? The newly generated c_mi will have two identical rows.

yesy6sysu avatar Jul 24 '24 16:07 yesy6sysu