Code for "M. Zhang, Z. Cui, M. Neumann, and Y. Chen, An End-to-End Deep Learning Architecture for Graph Classification, AAAI-18".

Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|

Dgl | 12,491 | 15 | 61 | 18 hours ago | 448 | August 30, 2023 | 426 | apache-2.0 | Python | |

Python package built to ease deep learning on graph, on top of existing DL frameworks. | ||||||||||

Tflearn | 9,602 | 481 | 8 | 18 days ago | 6 | November 11, 2020 | 576 | other | Python | |

Deep learning library featuring a higher-level API for TensorFlow. | ||||||||||

Darkflow | 6,111 | a month ago | 644 | gpl-3.0 | Python | |||||

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices | ||||||||||

Smile | 5,833 | 121 | 35 | a month ago | 33 | June 14, 2023 | 12 | other | Java | |

Statistical Machine Intelligence & Learning Engine | ||||||||||

Graph_nets | 5,284 | a year ago | n,ull | apache-2.0 | Python | |||||

Build Graph Nets in Tensorflow | ||||||||||

Graph_nets | 5,188 | 7 | 1 | a year ago | 7 | January 29, 2020 | 5 | apache-2.0 | Python | |

Build Graph Nets in Tensorflow | ||||||||||

Graph Based Deep Learning Literature | 4,418 | 12 days ago | mit | Jupyter Notebook | ||||||

links to conference publications in graph-based deep learning | ||||||||||

Euler | 2,846 | 5 months ago | 2 | April 10, 2019 | 218 | apache-2.0 | C++ | |||

A distributed graph deep learning framework. | ||||||||||

Stellargraph | 2,768 | 2 | 6 | 3 months ago | 24 | September 14, 2018 | 318 | apache-2.0 | Python | |

StellarGraph - Machine Learning on Graphs | ||||||||||

Yolov3 Tf2 | 2,501 | 2 months ago | 167 | mit | Jupyter Notebook | |||||

YoloV3 Implemented in Tensorflow 2.0 |

Alternatives To DgcnnSelect To Compare

Alternative Project Comparisons

Readme

The PyTorch implementation of DGCNN is here muhanzhang/pytorch_DGCNN, for those who prefer using python.

A powerful deep neural network toolbox for graph classification, named Deep-Graph-CNN (DGCNN). DGCNN features a propagation-based graph convolution layer to extract vertex features, as well as a novel SortPooling layer which sorts vertex representations instead of summing them up. The sorting enables learning from global graph topology, and retains much more node information than summing. The SortPooling layer supports backpropagation, and sorts vertices without using any preprocessing software such as Nauty, which enables an elegant end-to-end training framework.

For more information, please refer to:

M. Zhang, Z. Cui, M. Neumann, and Y. Chen, An End-to-End Deep Learning Architecture for Graph Classification, Proc. AAAI Conference on Artificial Intelligence (AAAI-18). [PDF]

The DGCNN is written in Torch. MATLAB is required if you want to compare DGCNN with graph kernels.

Run "th main.lua" to have a try of DGCNN!

If you do not have a deep learning environment yet, install cuda and Torch as follows (suppose you have a GPU):

Install cuda following: http://developer.nvidia.com/cuda-downloads

Install Torch following this link: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions

Then, install necessary Torch libraries: cutorch, cunn, in order by:

```
luarocks install --local libraryName
```

Now, you should be able to run Torch-based neural networks.

The folder "data/" contains the .dat graph datasets read by DGCNN. There is already a "MUTAG.dat" included for demo. Other graph datasets need to be generated manually:

```
th utils/generate_torch_graphs.lua
```

which transforms the .mat graph datasets in "data/raw_data/" into .dat format. The "torch.matio" is required to be installed:

```
1# OSX
brew install homebrew/science/libmatio
2# Ubuntu
sudo apt-get install libmatio2
luarocks install --local matio
```

In case you cannot install "torch.matio", we also provide the converted ".dat" for downloading directly [Torch graph datasets].

To run DGCNN on dataset "DD" (whose maximum node label is 89), with learning rate 1e-5, maximum epoch number 100, just type:

```
th main.lua -dataName DD -maxNodeLabel 89 -learningRate 1e-5 -maxEpoch 100
```

Append "-batch -batchSize 16" to run mini-batch optimization.

To repeatedly run DGCNN on some dataset using different shuffle orders, you can use the provided run_all.sh script:

```
time ./run_all.sh XXX i
```

which runs DGCNN on dataset XXX with the ith GPU of your machine for 100 times, using the shuffle orders stored in "data/shuffle" (matio is required).

The main program of DGCNN is in "main.lua", please refer to it for more advanced functions to play with!

DGCNN reads graph dataset in the format of dataset = {instance={i: {1: A_i, 2: X_i}}, label={i: label_i}}. You can check the format type:

```
dataset = torch.load("data/MUTAG.dat")
```

in the torch command line th.

We also provide a "generate_torch_graphs.lua" in "utils/" which converts standard WL kernel toolbox's graph format to DGCNN format.

There is an option "-testNumber 200" in "main.lua", which allows specifying that the last 200 examples in the dataset is the testing data. This is convenient when you put your testing data after the training data when constructing the dataset.

The kernel matrices of the compared graph kernels should be put into "data/kernels". Run:

```
ComputeKernels.m
```

to compute the kernel matrices of WL, GK and RW. Run:

```
Compute_PK_kernels.m
```

to compute the kernel matrices of PK (since the PK software uses a different graph format). We also provide the precomputed kernel matrices for downloading in case you don't want to compute them by yourselves. (Some of them take really long time!) [Kernel matrices]

To run graph kernels, run:

```
compare.m
```

in MATLAB, then the accuracy results of all graph kernels will be reported. At the same time, a fixed data shuffling order will be generated and saved in "data/shuffle" for each dataset (thus their train/val/test splits are fixed). These shuffle orders are already included in this toolbox. Change the *rand_start* inside compare.m to generate your own shuffle orders.

Torch libraries needed: paths, torch, nn, cunn, cutorch, optim. Install them using:

```
luarocks install --local libraryName
```

The main folder contains other required modules: SortPooling, GraphConv, GraphReLU, GraphTanh, GraphSelectTable, GraphConcatTable.

To compare DGCNN with graph kernels, libsvm is required to be installed in "software/libsvm-3.22". A zip of libsvm is included in "software/" already, you can unzip it and compile the mex files according to its documentations.

To compare with graph kernels, the toolbox "graphkernels" and "propagation_kernels-master" have been included in software/ already, which come from the following papers:

N. Shervashidze, P. Schweitzer, E. J. van Leeuwen, K. Mehlhorn, and K. M. Borgwardt. Weisfeiler-lehman graph kernels. Journal of Machine Learning Research, 12:2539-2561, 2011.

Marion Neumann, Roman Garnett, Christian Bauckhage, Kristian Kersting. Propagation kernels: efficient graph kernels from propagated information. (2015). Machine Learning. 102 (2), pp. 209-245.

If you find the code useful, please cite our paper:

```
@inproceedings{zhang2018end,
title={An End-to-End Deep Learning Architecture for Graph Classification},
author={Zhang, Muhan and Cui, Zhicheng and Neumann, Marion and Chen, Yixin},
booktitle={AAAI},
pages={4438--4445},
year={2018}
}
```

Muhan Zhang, [email protected] 12/2/2017

Popular Graph Projects

Popular Deep Learning Projects

Popular Computer Science Categories

Get A Weekly Email With Trending Projects For These Categories

No Spam. Unsubscribe easily at any time.

Deep

Dataset

Graph

Kernel

Matrices

Torch