Closed ObsisMc closed 1 year ago
Hi Ruihao,
Thank you for carefully checking our codes and proposing this issue. However, I think our implementation is correct since for the subgraph
function we set relabel_nodes=True
which will re-order the idx_i
from zero to idx_i.shape[0]
in the returned edge_index
. Therefore, the node index of the used edge_index
is consistent with the x_i
.
In terms of the experiments on obgn-arxiv, thank you for running our model on this dataset that we have not tried before. The 65% test acc seems not high for obgn-arxiv, so the performance impr here might not stem from the modified ordering part, but possibly the hyper-parameter settings in which NodeFormer does not perform well enough
Thank you for your reply, and I find it is the version of PyG that causes the problem.
My version is 2.1.0 and yours is 1.7.2. relabel_nodes
in 2.1.0 doesn't re-order index but in 1.7.2 does.
By the way, because of the problem, my training result in ogbn-proteins
is also about 72% like issue #3 and after fixing it, it can get around 77% like your paper does. Maybe issue #3 also met this problem.
I see. The PyG version indeed matters in practice. Thanks a lot for letting me know about this
Description
Maybe there is a bug in
main-batch.py
because of random permutation of index: https://github.com/qitianwu/NodeFormer/blob/64d26581f571340ab750ce6e60a8bb524e22e726/main-batch.py#L133-L144In line 135,
train_idx
is sorted butidx_i
is shuffled, then in line 136x_i
is also randomly permuted which means the original order of node has been changed. However in line 138, node idx inadjs[0]
is still in order andsubgraph()
also remain the order. In this way, in line 144,x_i
doesn't align withadjs_i
.Then, I change the code like this way so that the node idx can keep the original order:
Experiments
Before modification, test acc in
ogbn-arxiv
is only about 55%. After modification, test acc of it can be over 65%.