Skip to content

Commit

Permalink
[Example][Refactor] Refactor GCN example (dmlc#4160)
Browse files Browse the repository at this point in the history
* Refactor GCN example

* Refactor GCN based on graphsage

* Readme update

* Minor update

* update

* Remove user-defined GCN implementation

* README update

* Update

* Update CONTRIBUTORS.md

* update task_example_test

Co-authored-by: Xin Yao <[email protected]>
  • Loading branch information
chang-l and yaox12 authored Jul 5, 2022
1 parent 85f2811 commit 885be17
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 415 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ Contributors
* [Shaked Brody](https://github.com/shakedbr) from Technion
* [Jiahui Liu](https://github.com/paoxiaode) from Nvidia
* [Neil Dickson](https://github.com/ndickson-nvidia) from Nvidia
* [Chang Liu](https://github.com/chang-l) from Nvidia
36 changes: 12 additions & 24 deletions examples/pytorch/gcn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,21 @@ 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). Note that the original code is
implemented with Tensorflow for the paper.
- Author's code repo: [https://github.com/tkipf/gcn](https://github.com/tkipf/gcn).

Dependencies
------------
- PyTorch 0.4.1+
- requests

``bash
pip install torch requests
``

Codes
-----
The folder contains three implementations of GCN:
- `gcn.py` uses DGL's predefined graph convolution module.
- `gcn_mp.py` uses user-defined message and reduce functions.
Modify `train.py` to switch between different implementations.

Results
How to run
-------

Run with following (available dataset: "cora", "citeseer", "pubmed")
### DGL built-in GraphConv module

Run with the following (available dataset: "cora", "citeseer", "pubmed")
```bash
python3 train.py --dataset cora --gpu 0 --self-loop
python3 train.py --dataset cora
```

* cora: ~0.810 (0.79-0.83) (paper: 0.815)
* citeseer: 0.707 (paper: 0.703)
* pubmed: 0.792 (paper: 0.790)
Summary
-------
* cora: ~0.810 (paper: 0.815)
* citeseer: ~0.707 (paper: 0.703)
* pubmed: ~0.792 (paper: 0.790)

39 changes: 0 additions & 39 deletions examples/pytorch/gcn/gcn.py

This file was deleted.

233 changes: 0 additions & 233 deletions examples/pytorch/gcn/gcn_mp.py

This file was deleted.

Loading

0 comments on commit 885be17

Please sign in to comment.