README.md 3.66 KB
Newer Older
Da Zheng's avatar
Da Zheng committed
1
2
3
4
5
6
Graph Convolutional Networks (GCN)
============

Paper link: [https://arxiv.org/abs/1609.02907](https://arxiv.org/abs/1609.02907)
Author's code repo: [https://github.com/tkipf/gcn](https://github.com/tkipf/gcn)

7
8
9
10
11
12
13
14
Requirements
------------
- requests

``bash
pip install requests
``

Da Zheng's avatar
Da Zheng committed
15
16
Codes
-----
Ziyue Huang's avatar
Ziyue Huang committed
17
The folder contains two implementations of GCN. `gcn.py` uses user-defined
Da Zheng's avatar
Da Zheng committed
18
19
message and reduce functions. `gcn_spmv.py` uses DGL's builtin functions so
SPMV optimization could be applied.
Da Zheng's avatar
Da Zheng committed
20

Ziyue Huang's avatar
Ziyue Huang committed
21
22
23
The provided implementation in `gcn_concat.py` is a bit different from the
original paper for better performance, credit to @yifeim and @ZiyueHuang.

24
25
Results
-------
26
27
28
29
30
31
32
33
34
35
36
Run with following (available dataset: "cora", "citeseer", "pubmed")
```bash
DGLBACKEND=mxnet python gcn_spmv.py --dataset cora --gpu 0
```

* cora: ~0.810 (paper: 0.815)
* citeseer: ~0.702 (paper: 0.703)
* pubmed: ~0.780 (paper: 0.790)

Results (`gcn_concat.py`)
-------------------------
Da Zheng's avatar
Da Zheng committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
These results are based on single-run training to minimize the cross-entropy
loss of the first 20 examples in each class. We can see clear improvements of
graph convolution networks (GCNs) over multi-layer perceptron (MLP) baselines.
There are also some slight modifications from the original paper:

* We used more (up to 10) layers to demonstrate monotonic improvements as more
  neighbor information is used. Using GCN with more layers improves accuracy
but can also increase the computational complexity. The original paper
recommends n-layers=2 to balance speed and accuracy.
* We used concatenation of hidden units to account for multi-hop
  skip-connections. The original implementation used simple additions (while
the original paper omitted this detail). We feel concatenation is superior
because all neighboring information is presented without additional modeling
assumptions.
* After the concatenation, we used a recursive model such that the (k+1)-th
  layer, storing information up to the (k+1)-distant neighbor, depends on the
concatenation of all 1-to-k layers. However, activation is only applied to the
new information in the concatenations.
55
56

```
57
# Final accuracy 75.34% MLP without GCN
58
DGLBACKEND=mxnet python examples/mxnet/gcn/gcn_concat.py --dataset "citeseer" --n-epochs 200 --gpu 1 --n-layers 0
59
60

# Final accuracy 86.57% with 10-layer GCN (symmetric normalization)
61
DGLBACKEND=mxnet python examples/mxnet/gcn/gcn_concat.py --dataset "citeseer" --n-epochs 200 --gpu 1 --n-layers 10 --normalization 'sym' --self-loop
62
63

# Final accuracy 84.42% with 10-layer GCN (unnormalized)
64
DGLBACKEND=mxnet python examples/mxnet/gcn/gcn_concat.py --dataset "citeseer" --n-epochs 200 --gpu 1 --n-layers 10
65
66
67
```

```
68
# Final accuracy 40.62% MLP without GCN
69
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "cora" --n-epochs 200 --gpu 1 --n-layers 0
70
71

# Final accuracy 92.63% with 10-layer GCN (symmetric normalization)
72
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "cora" --n-epochs 200 --gpu 1 --n-layers 10 --normalization 'sym' --self-loop
73
74

# Final accuracy 86.60% with 10-layer GCN (unnormalized)
75
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "cora" --n-epochs 200 --gpu 1 --n-layers 10
76
77
78
```

```
79
# Final accuracy 72.97% MLP without GCN
80
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "pubmed" --n-epochs 200 --gpu 1 --n-layers 0
81
82

# Final accuracy 88.33% with 10-layer GCN (symmetric normalization)
83
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "pubmed" --n-epochs 200 --gpu 1 --n-layers 10 --normalization 'sym' --self-loop
84
85

# Final accuracy 83.80% with 10-layer GCN (unnormalized)
86
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "pubmed" --n-epochs 200 --gpu 1 --n-layers 10
87
```