Skip to content

Commit

Permalink
[Example] rm gcn spmv (dmlc#2044)
Browse files Browse the repository at this point in the history
* rm gcn spmv

* remove useless test

* remove useless test

Co-authored-by: Ubuntu <[email protected]>
  • Loading branch information
classicsong and Ubuntu authored Aug 18, 2020
1 parent 6d34628 commit 09ec602
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 189 deletions.
23 changes: 1 addition & 22 deletions examples/mxnet/gcn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ 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.
- `gcn_spmv.py` improves from `gcn_mp.py` by using DGL's builtin functions
so SPMV optimization could be applied.
Modify `train.py` to switch between different implementations.

The provided implementation in `gcn_concat.py` is a bit different from the
Expand All @@ -40,8 +38,7 @@ DGLBACKEND=mxnet python3 train.py --dataset cora --gpu 0 --self-loop
Results (`gcn_concat.py vs. gcn.py`)
------------------------------------
`gcn_concat.py` uses concatenation of hidden units to account for multi-hop
skip-connections, while `gcn_spmv.py` uses simple additions (the original paper
omitted this detail). We feel concatenation is superior
skip-connections. We feel concatenation is superior
because all neighboring information is presented without additional modeling
assumptions.
These results are based on single-run training to minimize the cross-entropy
Expand All @@ -56,12 +53,6 @@ factorization. Given the small datasets, we can't draw such conclusions from the
# Final accuracy 57.70% MLP without GCN
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "citeseer" --n-epochs 200 --n-layers 0
# Final accuracy 68.20% with 2-layer GCN
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_spmv.py --dataset "citeseer" --n-epochs 200 --n-layers 1
# Final accuracy 18.40% with 10-layer GCN
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_spmv.py --dataset "citeseer" --n-epochs 200 --n-layers 9
# Final accuracy 65.70% with 10-layer GCN with skip connection
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "citeseer" --n-epochs 200 --n-layers 2 --normalization 'sym' --self-loop
Expand All @@ -74,12 +65,6 @@ DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "citeseer" -
# Final accuracy 53.20% MLP without GCN
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "cora" --n-epochs 200 --n-layers 0
# Final accuracy 81.40% with 2-layer GCN
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_spmv.py --dataset "cora" --n-epochs 200 --n-layers 1
# Final accuracy 27.60% with 10-layer GCN
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_spmv.py --dataset "cora" --n-epochs 200 --n-layers 9
# Final accuracy 72.60% with 2-layer GCN with skip connection
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "cora" --n-epochs 200 --n-layers 2 --normalization 'sym' --self-loop
Expand All @@ -92,12 +77,6 @@ DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "cora" --n-e
# Final accuracy 70.30% MLP without GCN
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "pubmed" --n-epochs 200 --n-layers 0
# Final accuracy 77.40% with 2-layer GCN
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_spmv.py --dataset "pubmed" --n-epochs 200 --n-layers 1
# Final accuracy 36.20% with 10-layer GCN
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_spmv.py --dataset "pubmed" --n-epochs 200 --n-layers 9
# Final accuracy 78.30% with 2-layer GCN with skip connection
DGLBACKEND=mxnet python3 examples/mxnet/gcn/gcn_concat.py --dataset "pubmed" --n-epochs 200 --n-layers 2 --normalization 'sym' --self-loop
Expand Down
79 changes: 0 additions & 79 deletions examples/mxnet/gcn/gcn_spmv.py

This file was deleted.

2 changes: 0 additions & 2 deletions examples/pytorch/gcn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ 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.
- `gcn_spmv.py` improves from `gcn_mp.py` by using DGL's builtin functions
so SPMV optimization could be applied.
Modify `train.py` to switch between different implementations.

Results
Expand Down
83 changes: 0 additions & 83 deletions examples/pytorch/gcn/gcn_spmv.py

This file was deleted.

1 change: 0 additions & 1 deletion tests/scripts/task_example_test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ SET DGL_DOWNLOAD_DIR=!CD!
PUSHD !GCN_EXAMPLE_DIR!
python pagerank.py || GOTO :FAIL
python gcn\gcn.py --dataset cora --gpu !DEV! || GOTO :FAIL
python gcn\gcn_spmv.py --dataset cora --gpu !DEV! || GOTO :FAIL
POPD
ENDLOCAL
EXIT /B
Expand Down
3 changes: 1 addition & 2 deletions tests/scripts/task_example_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ pushd $GCN_EXAMPLE_DIR> /dev/null

python3 pagerank.py || fail "run pagerank.py on $1"
python3 gcn/gcn.py --dataset cora --gpu $dev || fail "run gcn/gcn.py on $1"
python3 gcn/gcn_spmv.py --dataset cora --gpu $dev || fail "run gcn/gcn_spmv.py on $1"

popd > /dev/null
popd > /dev/null

0 comments on commit 09ec602

Please sign in to comment.