nju-websoft / RSN

Learning to Exploit Long-term Relational Dependencies in Knowledge Graphs, ICML 2019
MIT License
100 stars 17 forks source link

Why is the depth biased calculated differently from what's described in the paper? #6

Closed aishahasmoh closed 4 years ago

aishahasmoh commented 4 years ago

In the sampler, the 'pre' column is used to represent the previous entity in the path. However, it doesn't change with the length of the path so far. It's always set to be the first entity in the path. This is done in initializing the 'pre' column in line: curr.loc[:, 'pre'] = hrt[:, 0] This line puts the first entity in the path in the pre column.

For example, if the path so far is: e1, r1, e2, r2, e3, r3, e4 and we are computing the depth bias for the entities that are neighbors to e4, then we will find for each candidate entity ei the bias between (e1, ei) rather than the bias between (e3, ei).

In the paper, its described as such that we calculate the bias between (ei-1, e+1) rather than (e1, ei+1). Can you please explain why this is happenning?

Thanks,

guolingbing commented 4 years ago

Hi, thanks for your attention to our work. As shown in the corresponding comment, calculating the bias based on (e1, ei+1) is a stronger way to sample deeper path. We actually found this trick in code revison. If you replace this line with "curr.loc[:, 'pre'] = pre", the performance only drops slightly, still matching the results reported in the paper.