Giter Site home page Giter Site logo

jdc08161063 / asap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from malllabiisc/asap

0.0 1.0 0.0 1.72 MB

AAAI 2020 - ASAP: Adaptive Structure Aware Pooling for Learning Hierarchical Graph Representations

License: Apache License 2.0

Python 100.00%

asap's Introduction

ASAP: Adaptive Structure Aware Pooling for Learning Hierarchical Graph Representations

Conference Paper

Source code for AAAI 2020 paper: ASAP: Adaptive Structure Aware Pooling for Learning Hierarchical Graph Representation

Overview of ASAP: ASAP initially considers all possible local clusters with a fixed receptive field for a given input graph. It then computes the cluster membership of the nodes using an attention mechanism. These clusters are then scored using a GNN. Further, a fraction of the top scoring clusters are selected as nodes in the pooled graph and new edge weights are computed between neighboring clusters. Please refer to Section 4 of the paper for details.

File Descriptions

  • main.py - contains the driver code for the whole project
  • asap_pool.py - source code for ASAP pooling operator proposed in the paper
  • le_conv.py - source code for LEConv GNN used in the paper
  • asap_pool_model.py - a network which uses ASAP pooling as pooling operator

Dependencies

  • Python 3.x
  • Pytorch (1.5)
  • Pytorch_Scatter (2.0.4)
  • Pytorch_Sparse (0.6.3)
  • Pytorch_Geometric (1.4.3)

Use the following commands to install the above version of dependency:

pip install torch==1.5.0+${CUDA} -f https://download.pytorch.org/whl/torch_stable.html
pip install torch-scatter==2.0.4+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.5.0.html
pip install torch-sparse==0.6.3+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.5.0.html
pip install torch-geometric==1.4.3

where where ${CUDA} should be replaced by either cpu, cu92, cu101 or cu102 depending on your PyTorch installation and CUDA version.

E.g., if your CUDA version is 9.2 then run:

pip install torch==1.5.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html
pip install torch-scatter==2.0.4+cu92 -f https://pytorch-geometric.com/whl/torch-1.5.0.html
pip install torch-sparse==0.6.3+cu92 -f https://pytorch-geometric.com/whl/torch-1.5.0.html
pip install torch-geometric==1.4.3

Training a model from scratch

Example for PROTEINS dataset:

python main.py -data PROTEINS -batch 128 -hid_dim 64 -dropout_att 0.1 -lr 0.01

Hyperparameters to reproduce reported scores in the paper

Dataset Batch Size Hidden Dimension Dropout Learning rate
PROTEINS 128 64 0.1 0.01
FRANKENSTEIN 128 32 0 0.001
NCI1 128 128 0 0.01
NCI109 128 128 0 0.01
DD 64 16 0.3 0.01

Citation:

Please cite the following paper if you found it useful in your work.

@article{ranjan2019asap,
  title={{ASAP}: Adaptive Structure Aware Pooling for Learning Hierarchical Graph Representations},
  author={Ranjan, Ekagra and Sanyal, Soumya and Talukdar, Partha Pratim},
  journal={arXiv preprint arXiv:1911.07979},
  year={2019}
}

For any clarification, comments, or suggestions please create an issue or contact Ekagra.

asap's People

Contributors

ekagra-ranjan avatar soumyasanyal avatar parthatalukdar avatar

Watchers

James Cloos 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.