项目文件夹

文件
Hongzhi (Steve), Chen 704bcaf6dd examples (#5323)
Co-authored-by: Ubuntu <ubuntu@ip-172-31-28-63.ap-northeast-1.compute.internal>
2023-02-19 08:35:15 +08:00
..
2023-02-19 08:35:15 +08:00
2023-02-19 08:35:15 +08:00
2023-02-19 08:35:15 +08:00
2023-02-19 08:35:15 +08:00
2023-02-19 08:35:15 +08:00
2023-02-19 08:35:15 +08:00
2023-02-19 08:35:15 +08:00

Relational-GCN

Dependencies

  • rdflib
  • torchmetrics

Install as follows:

pip install rdflib
pip install torchmetrics

How to run

Entity Classification

Run with the following for entity classification (available datasets: aifb (default), mutag, bgs, and am)

python3 entity.py --dataset aifb

For mini-batch training, run with the following (available datasets are the same as above)

python3 entity_sample.py --dataset aifb

For multi-gpu training (with sampling), run with the following (same datasets and GPU IDs separated by comma)

python3 entity_sample_multi_gpu.py --dataset aifb --gpu 0,1

Run with the following for link prediction on dataset FB15k-237 with filtered-MRR

python link.py

NOTE: By default, we use uniform edge sampling instead of neighbor-based edge sampling as in author's code. In practice, we find that it can achieve similar MRR.

Summary

Entity Classification

Dataset Full-graph Mini-batch
aifb ~0.85 ~0.82
mutag ~0.70 ~0.50
bgs ~0.86 ~0.64
am ~0.78 ~0.42
Dataset Best MRR
FB15k-237 ~0.2439