{"id":17659909,"url":"https://github.com/thiviyant/torch-rgcn","last_synced_at":"2025-10-09T20:06:46.072Z","repository":{"id":69655412,"uuid":"265267825","full_name":"thiviyanT/torch-rgcn","owner":"thiviyanT","description":"A PyTorch implementation of the Relational Graph Convolutional Network (RGCN).","archived":false,"fork":false,"pushed_at":"2021-08-11T11:47:35.000Z","size":14658,"stargazers_count":128,"open_issues_count":8,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-05T06:11:50.623Z","etag":null,"topics":["graph-convolutional-network","graph-neural-network","link-prediction","node-classification","relational-graphs"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thiviyanT.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-19T14:19:43.000Z","updated_at":"2025-09-01T13:53:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"93f52873-4b13-4f25-be1e-9be074adf3f7","html_url":"https://github.com/thiviyanT/torch-rgcn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thiviyanT/torch-rgcn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiviyanT%2Ftorch-rgcn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiviyanT%2Ftorch-rgcn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiviyanT%2Ftorch-rgcn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiviyanT%2Ftorch-rgcn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiviyanT","download_url":"https://codeload.github.com/thiviyanT/torch-rgcn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiviyanT%2Ftorch-rgcn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002016,"owners_count":26083258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph-convolutional-network","graph-neural-network","link-prediction","node-classification","relational-graphs"],"created_at":"2024-10-23T16:29:03.001Z","updated_at":"2025-10-09T20:06:46.065Z","avatar_url":"https://github.com/thiviyanT.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Torch-RGCN \n\nTorch-RGCN is a PyTorch implementation of the RGCN, originally proposed by Schlichtkrull *et al.* in  \n[Modeling Relational Data with Graph Convolutional Networks](https://arxiv.org/abs/1703.06103).\n \nIn our [paper](https://arxiv.org/abs/2107.10015), we reproduce the link prediction  and node classification experiments from the original \npaper and using our reproduction we explain the RGCN. Furthermore, we present two new configurations of the RGCN. \n\n## Getting started\n\nRequirements: \n* Conda \u003e= 4.8\n* Python \u003e= 3.7\n\nDo the following: \n\n1. Download all datasets: `bash get_data.sh`\n\n2. Install the dependencies inside a new virtual environment: `bash setup_dependencies.sh`\n\n3. Activate the virtual environment: `conda activate torch_rgcn_venv`\n\n4. Install the torch-RGCN module: `pip install -e .`  \n\n## Usage\n\n### Configuration files\n\nThe hyper-parameters for the different experiments can be found in [YAML](https://yaml.org/) files under \n[configs](configs). The naming convention of the files is as follows: `configs/{MODEL}/{EXPERIMENT}-{DATASET}.yaml`\n\n### Models\n* `rgcn` - Standard RGCN Model \n* `c-rgcn` - Compression RGCN Model \n* `e-rgcn` - Embedding RGCN Model\n\n### Experiments\n* `lp` - Link Prediction\n* `nc` - Node Classification \n\n### Datasets\n\n#### Link Prediction\n \n * `WN18`  \n * `FB-Toy`\n\n#### Node Classification \n\n * `AIFB`  \n * `MUTAG` \n * `BGS` \n * `AM`\n\n## Part 1: Reproduction  \n\n### Link Prediction \n\n![Link Prediction Model](images/link-prediction.png)\n\nOriginal Link Prediction Implementation: https://github.com/MichSchli/RelationPrediction \n\nTo run the link prediction experiment using the RGCN model using:\n\n`python experiments/predict_links.py with configs/rgcn/lp-{DATASET}.yaml`\n\nMake sure to replace `{DATASET}` with one of the following dataset names: `FB-toy` or `WN18`.\n\n### Node Classification\n\n![Node Classification Model](images/node-classification.png)\n\nOriginal Node Classification Implementation: https://github.com/tkipf/relational-gcn\n\nTo run the node classification experiment using the RGCN model using:\n\n`python experiments/classify_nodes.py with configs/rgcn/nc-{DATASET}.yaml`\n\nMake sure to replace `{DATASET}` with one of the following dataset names: `AIFB`, `MUTAG`, `BGS` or `AM`.\n\n## Part 2: New RGCN Configurations \n\n### Node Classification with Node Embeddings \n\nTo run the node classification experiment use: \n\n`python experiments/classify_nodes.py with configs/e-rgcn/nc-{DATASET}.yaml`\n\nMake sure to replace `{DATASET}` with one of the following dataset names: `AIFB`, `MUTAG`, `BGS` or `AM`.\n\n### Link Prediction Compressed Node Embeddings\n\n![c-RGCN Link Prediction Model](images/link-prediction-compression.png)\n\nTo run the link prediction experiment use: \n\n`python experiments/predict_links.py with configs/c-rgcn/lp-{DATASET}.yaml`\n\nMake sure to replace `{DATASET}` with one of the following dataset names: `FB-toy`, or `WN18`.\n\n\n---\n\n### Dataset References\n\n#### Node Classification\n\n * `AIFB` from \n Stephan Bloehdorn and York Sure. \n *[Kernel methods for mining instance data in ontologies.](https://link.springer.com/content/pdf/10.1007%2F978-3-540-76298-0_5.pdf).* \n In The Semantic Web, 6th International Semantic Web Conference,  2007. \n * `MUTAG` from \n A. K. Debnath, R. L. Lopez de Compadre, G. Debnath, A. J.Shusterman, and C. Hansch. \n *[Structure-activity relationship of mutagenic aromatic and heteroaromatic nitro-compounds correlation \n with molecular orbital energies and hydrophobicity](https://pubs.acs.org/doi/pdf/10.1021/jm00106a046?casa_token=ECo0FUp3gNoAAAAA:6Xgkt3vGuQeVFnGwlPlyDWm-fIflRmsRe7s5X_SH143O4-wVz5eIMHj_cmDvBWCVon6LLvVt0nTgy-4).* \n J Med Chem,34:786–797, 1991.\n * `BGS` from \n de Vries, G.K.D.\n *[A fast approximation of the Weisfeiler-Lehman graph kernel for RDF data](https://link.springer.com/content/pdf/10.1007%2F978-3-642-40988-2_39.pdf).* \n In European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases, 2013.\n * `AM` from \nde Boer, V., Wielemaker, J., van Gent, J., Hildebrand, M., Isaac, A., van Ossenbruggen, J., Schreiber, G.\n*[Supporting linked data production for cultural heritageinstitutes: The amsterdam museum case study](https://link.springer.com/content/pdf/10.1007%2F978-3-642-30284-8_56.pdf).* \nIn The Semantic Web: Research and Applications, 2012.\n\n#### Link Prediction\n \n * `WN18` from \n Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran , Jason Weston, and Oksana Yakhnenko. \n *[Translating embeddings for modeling multi-relational data](http://papers.nips.cc/paper/5071-translating-embeddings-for-modeling-multi-rela)*.\n In Advances in Neural Information Processing Systems, 2013. \n * `FB-Toy` from \n Daniel Ruffinelli, Samuel Broscheit, and Rainer Gemulla. \n *[You CAN teach an old dog new tricks! on training knowledge graph embeddings](https://openreview.net/pdf?id=BkxSmlBFvr)*.\n In International Conference on Learning Representations, 2019. \n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiviyant%2Ftorch-rgcn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiviyant%2Ftorch-rgcn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiviyant%2Ftorch-rgcn/lists"}