toooooodo / CompGCN-DGL

An implement of CompGCN in Pytorch and DGL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Composition-Based Multi-Relational Graph Convolutional Networks

An implement of CompGCN in Pytorch and DGL.

Dependencies

  1. install Python3
  2. install requirements pip install -r requirements.txt

Train Model

To start training process:

python run.py --score_func conve --opn corr --gpu 0 --epoch 500 --batch 256 --n_layer 1
  • --score_func denotes the link prediction score score function
  • --opn is the composition operation used in CompGCN. It can take the following values:
    • sub for subtraction operation: Φ(e_s, e_r) = e_s - e_r
    • mult for multiplication operation: Φ(e_s, e_r) = e_s * e_r
    • corr for circular-correlation: Φ(e_s, e_r) = e_s ★ e_r
  • --gpu for specifying the GPU to use
  • --epoch for number of epochs
  • --batch for batch size
  • --n_layer for number of GCN Layers to use
  • Rest of the arguments can be listed using python run.py -h

Test Result

FB15k-237

model MRR MR Hits@1 Hits@3 Hits@10
Conve-mult 0.35516 222 0.26337 0.39021 0.53767
Conve-corr 0.35340 199 0.26146 0.38778 0.53791
DistMult-mult 0.33590 234 0.24697 0.36656 0.51639
DistMult-corr 0.33680 242 0.24875 0.36624 0.51575

About

An implement of CompGCN in Pytorch and DGL.


Languages

Language:Python 100.0%