Torch Rgcn Save

A PyTorch implementation of the Relational Graph Convolutional Network (RGCN).

Project README

Torch-RGCN

Torch-RGCN is a PyTorch implementation of the RGCN, originally proposed by Schlichtkrull et al. in
Modeling Relational Data with Graph Convolutional Networks.

In our paper, we reproduce the link prediction and node classification experiments from the original paper and using our reproduction we explain the RGCN. Furthermore, we present two new configurations of the RGCN.

Getting started

Requirements:

  • Conda >= 4.8
  • Python >= 3.7

Do the following:

  1. Download all datasets: bash get_data.sh

  2. Install the dependencies inside a new virtual environment: bash setup_dependencies.sh

  3. Activate the virtual environment: conda activate torch_rgcn_venv

  4. Install the torch-RGCN module: pip install -e .

Usage

Configuration files

The hyper-parameters for the different experiments can be found in YAML files under configs. The naming convention of the files is as follows: configs/{MODEL}/{EXPERIMENT}-{DATASET}.yaml

Models

  • rgcn - Standard RGCN Model
  • c-rgcn - Compression RGCN Model
  • e-rgcn - Embedding RGCN Model

Experiments

  • lp - Link Prediction
  • nc - Node Classification

Datasets

  • WN18
  • FB-Toy

Node Classification

  • AIFB
  • MUTAG
  • BGS
  • AM

Part 1: Reproduction

Link Prediction Model

Original Link Prediction Implementation: https://github.com/MichSchli/RelationPrediction

To run the link prediction experiment using the RGCN model using:

python experiments/predict_links.py with configs/rgcn/lp-{DATASET}.yaml

Make sure to replace {DATASET} with one of the following dataset names: FB-toy or WN18.

Node Classification

Node Classification Model

Original Node Classification Implementation: https://github.com/tkipf/relational-gcn

To run the node classification experiment using the RGCN model using:

python experiments/classify_nodes.py with configs/rgcn/nc-{DATASET}.yaml

Make sure to replace {DATASET} with one of the following dataset names: AIFB, MUTAG, BGS or AM.

Part 2: New RGCN Configurations

Node Classification with Node Embeddings

To run the node classification experiment use:

python experiments/classify_nodes.py with configs/e-rgcn/nc-{DATASET}.yaml

Make sure to replace {DATASET} with one of the following dataset names: AIFB, MUTAG, BGS or AM.

c-RGCN Link Prediction Model

To run the link prediction experiment use:

python experiments/predict_links.py with configs/c-rgcn/lp-{DATASET}.yaml

Make sure to replace {DATASET} with one of the following dataset names: FB-toy, or WN18.


Dataset References

Node Classification

Open Source Agenda is not affiliated with "Torch Rgcn" Project. README Source: thiviyanT/torch-rgcn

Open Source Agenda Badge

Open Source Agenda Rating