README.md 1.01 KB
Newer Older
Lingfan Yu's avatar
Lingfan Yu committed
1
2
# Relational-GCN

Gan Quan's avatar
Gan Quan committed
3
4
5
6
* Paper: [https://arxiv.org/abs/1703.06103](https://arxiv.org/abs/1703.06103)
* Author's code for entity classification: [https://github.com/tkipf/relational-gcn](https://github.com/tkipf/relational-gcn)
* Author's code for link prediction: [https://github.com/MichSchli/RelationPrediction](https://github.com/MichSchli/RelationPrediction)

Lingfan Yu's avatar
Lingfan Yu committed
7
8
9
10
11
12
13
14
15
### Prerequisites
Two extra python packages are needed for this example: 

- rdflib
- pandas

Example code was tested with rdflib 4.2.2 and pandas 0.23.4

### Entity Classification
16
AIFB: accuracy 97.22% (DGL), 95.83% (paper)
Lingfan Yu's avatar
Lingfan Yu committed
17
18
19
20
```
python3 entity_classify.py -d aifb --testing --gpu 0
```

21
MUTAG: accuracy 75% (DGL), 73.23% (paper)
Lingfan Yu's avatar
Lingfan Yu committed
22
23
24
25
```
python3 entity_classify.py -d mutag --l2norm 5e-4 --n-bases 30 --testing --gpu 0
```

26
BGS: accuracy 82.76% (DGL), 83.10% (paper)
Lingfan Yu's avatar
Lingfan Yu committed
27
28
29
30
31
```
python3 entity_classify.py -d bgs --l2norm 5e-4 --n-bases 40 --testing --gpu 0 --relabel
```

### Link Prediction
32
FB15k-237: MRR 0.151 (DGL), 0.158 (paper)
Lingfan Yu's avatar
Lingfan Yu committed
33
34
35
```
python3 link_predict.py -d FB15k-237 --gpu 0
```