Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

The code of RGCN #7

Open
wzfhaha opened this issue May 5, 2022 · 1 comment
Open

The code of RGCN #7

wzfhaha opened this issue May 5, 2022 · 1 comment

Comments

@wzfhaha
Copy link

wzfhaha commented May 5, 2022

Dear authors,
I have noticed that the RGCN has an accuracy of 50.0% on MAG in your paper, which is higher than RGCN's result reported in OGB leaderboard. Could you share your codes for the RGCN model you used in the paper? Thanks very much!

@lingfanyu
Copy link
Contributor

Hi @wzfhaha

I used the sampling version of RGCN(https://github.com/snap-stanford/ogb/blob/master/examples/nodeproppred/mag/sampler.py) from leaderboard.

The main change is we also generated features for those featureless nodes (like author, institution, topic), and increased the number of layers to match NARS. I think that's the main reason for the better accuracy.

The code for loading features into the graph is:

with torch.no_grad():
    rand_weight = torch.Tensor(128, 256).uniform_(-0.5, 0.5)
    data.x_dict["paper"] = torch.matmul(data.x_dict["paper"], rand_weight)
    data.x_dict["author"] = torch.load(os.path.join(args.emb, "author.pt")).float()
    data.x_dict["institution"] = torch.load(os.path.join(args.emb, "institution.pt")).float()
    data.x_dict["field_of_study"] = torch.load(os.path.join(args.emb, "topic.pt")).float()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants