Code Monkey home page Code Monkey logo

dgcnn's Introduction

DGCNN

A PyTorch implementation of DGCNN based on AAAI 2018 paper An End-to-End Deep Learning Architecture for Graph Classification.

Requirements

conda install pytorch torchvision -c pytorch
  • PyTorchNet
pip install git+https://github.com/pytorch/tnt.git@master
pip install torch-scatter
pip install torch-sparse
pip install torch-cluster
pip install torch-spline-conv (optional)
pip install torch-geometric

Datasets

The datasets are collected from graph kernel datasets. The code will download and extract them into data directory automatically. The 10fold_idx files are collected from pytorch_DGCNN.

Usage

Train Model

python -m visdom.server -logging_level WARNING & python train.py --data_type PTC_MR --num_epochs 200
optional arguments:
--data_type                   dataset type [default value is 'DD'](choices:['DD', 'PTC_MR', 'NCI1', 'PROTEINS', 'IMDB-BINARY', 'IMDB-MULTI', 'MUTAG', 'COLLAB'])
--batch_size                  train batch size [default value is 50]
--num_epochs                  train epochs number [default value is 100]

Visdom now can be accessed by going to 127.0.0.1:8097/env/$data_type in your browser, $data_type means the dataset type which you are training.

Benchmarks

Default PyTorch Adam optimizer hyper-parameters were used without learning rate scheduling. The model was trained with 100 epochs and batch size of 50 on a NVIDIA GTX 1070 GPU.

Here is tiny difference between this code and official paper. X is defined as a concatenated matrix of vertex labels、 vertex attributes and normalized node degrees.

Dataset MUTAG PTC NCI1 PROTEINS D&D COLLAB IMDB-B IMDB-M
Num. of Graphs 188 344 4,110 1,113 1,178 5,000 1,000 1,500
Num. of Classes 2 2 2 2 2 3 2 3
Node Attr. (Dim.) 8 19 38 5 90 1 1 1
Num. of Parameters 52,035 52,387 52,995 51,939 54,659 51,940 51,811 51,940
DGCNN (official) 85.83±1.66 58.59±2.47 74.44±0.47 75.54±0.94 79.37±0.94 73.76±0.49 70.03±0.86 47.83±0.85
DGCNN (ours) 81.67±9.64 59.12±11.27 75.72±3.13 72.88±3.38 68.80±5.37 70.52±2.00 71.50±4.48 46.47±5.22
Training Time 4.48s 6.77s 61.04s 21.15s 64.71s 202.65s 15.55s 21.90s

Results

The train loss、accuracy, test loss、accuracy are showed on visdom.

MUTAG

result

PTC

result

NCI1

result

PROTEINS

result

D&D

result

COLLAB

result

IMDB-B

result

IMDB-M

result

dgcnn's People

Contributors

leftthomas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.