Giter Site home page Giter Site logo

rgcn's Introduction

PyTorch RGCN (Link Prediction)

PyTorch implementation of Relational Link Prediction of RGCN (Modeling Relational Data with Graph Convolutional Networks). The code is sparsely optimized with torch_geometric library, which is builded based on PyTorch.

About

This is the original tensorflow implementation of link prediction of RGCN: https://github.com/MichSchli/RelationPrediction

Also, most of the functions in utils.py are brought from the following repository: https://github.com/dmlc/dgl/tree/master/examples/pytorch/rgcn, where this repositroy is based on another popular graph library, namely dgl.

Requirements

This code is lastly tested with:

  • python 3.7.x
  • pytorch 1.7.x
  • torch_geometric 1.7.x, with torch_scatter 2.0.6 and torch_sparse 0.6.9

rgcn's People

Contributors

jinheonbaek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rgcn's Issues

How is a MRR score of 0.20 possible?

I trained with your code and got an MRR of 0.2. In the original paper they only reach an MRR score of 0.156. How is my score with a model with fewer parameters than the original approach possible?

error

Namespace(dropout=0.2, evaluate_every=500, gpu=-1, grad_norm=1.0, graph_batch_size=30000, graph_split_size=0.5, lr=0.01, n_bases=4, n_epochs=10000, negative_sample=1, regularization=0.01)
load data from ./data/FB15k-237
num_entity: 14541
num_relation: 237
num_train_triples: 272115
num_valid_triples: 17535
num_test_triples: 20466
Traceback (most recent call last):
  File "main.py", line 121, in <module>
    main(args)
  File "main.py", line 48, in main
    test_graph = build_test_graph(len(entity2id), len(relation2id), train_triplets)
  File "utils.py", line 156, in build_test_graph
    data = Data(edge_index = edge_index)
  File "C:\Users\xxxxxxxxx\.conda\envs\a4\lib\site-packages\torch_geometric\data\data.py", line 88, in __init__
    raise ValueError(
ValueError: Argument `edge_index` needs to be of type `torch.long` but found type `torch.int32`

Which version do u use ? I have some troubles in torch_scatter

It is a great jobs and I'm very appreciate about it.
But when i trying to : pip install torch_scatter the terminal returns a stack red error seems that my cuda version not fitted with it
So could u please tell me about the version u use ?
Thanks a lot~

work on entity alignment

does r-gcn works on entity alignment (existing R-GCN seems only focus on classification and link prediction)?

If yes, May I know do you have any working code on this?

or does this link prediction model works directly on that? Since “Links between two nodes exist” is very similar to “two nodes referring to same real-world object”

RGCN model conv1 is applied two times.

In the RGCN model, conv1 is applied twice in succession. Is that intended?

x = self.conv1(x, edge_index, edge_type, edge_norm)        
x = F.relu(self.conv1(x, edge_index, edge_type, edge_norm))

Can't reproduce results in the paper

Hi,
Thanks for your excellent job! This is the only repo I can find that is implemented in torch_geometric. But I can't reproduce results using your code. Can you show me your results and configurations.
Thanks.

The memory overflow

I use your code as a part in our experiment.
But there is a problem about the test_graph.
Because the code uses all train triplets to build graph during valid and test, so when I test the model, 64G memory is not enough.
So I wish you to give me some suggestions.
Thank you very much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.