Code for "M. Zhang, Z. Cui, M. Neumann, and Y. Chen, An End-to-End Deep Learning Architecture for Graph Classification, AAAI-18".
Alternatives To Dgcnn
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Dgl12,491156118 hours ago448August 30, 2023426apache-2.0Python
Python package built to ease deep learning on graph, on top of existing DL frameworks.
Tflearn9,602481818 days ago6November 11, 2020576otherPython
Deep learning library featuring a higher-level API for TensorFlow.
a month ago644gpl-3.0Python
Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
Smile5,83312135a month ago33June 14, 202312otherJava
Statistical Machine Intelligence & Learning Engine
a year agon,ullapache-2.0Python
Build Graph Nets in Tensorflow
Graph_nets5,18871a year ago7January 29, 20205apache-2.0Python
Build Graph Nets in Tensorflow
Graph Based Deep Learning Literature4,418
12 days agomitJupyter Notebook
links to conference publications in graph-based deep learning
5 months ago2April 10, 2019218apache-2.0C++
A distributed graph deep learning framework.
Stellargraph2,768263 months ago24September 14, 2018318apache-2.0Python
StellarGraph - Machine Learning on Graphs
Yolov3 Tf22,501
2 months ago167mitJupyter Notebook
YoloV3 Implemented in Tensorflow 2.0
Alternatives To Dgcnn
Select To Compare

Alternative Project Comparisons

Deep Graph Convolutional Neural Network (DGCNN)

Update 3/19/2018

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!

How to run 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!

How to use your own datasets

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.

How to compare with graph kernels

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


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


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:


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.

Required libraries

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:

    title={An End-to-End Deep Learning Architecture for Graph Classification},
    author={Zhang, Muhan and Cui, Zhicheng and Neumann, Marion and Chen, Yixin},

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.