Need help with HGP-SL?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

cszhangzhen
151 Stars 21 Forks 21 Commits 2 Opened issues

Description

Hierarchical Graph Pooling with Structure Learning

Services available

!
?

Need anything else?

Contributors list

# 219,563
Python
graph-c...
pytorch
gcn
21 commits

HGP-SL

Hierarchical Graph Pooling with Structure Learning (Preprint version is available on arXiv).

This is a PyTorch implementation of the HGP-SL algorithm, which learns a low-dimensional representation for the entire graph. Specifically, the graph pooling operation utilizes node features and graph structure information to perform down-sampling on graphs. Then, a structure learning layer is stacked on the pooling operation, which aims to learn a refined graph structure that can best preserve the essential topological information.

Requirements

  • python3.6
  • pytorch==1.5.0
  • torch-scatter==2.0.4
  • torch-sparse==0.6.4
  • torch-cluster==1.5.4
  • torch-geometric==1.5.0

Note: This code repository is heavily built on pytorch_geometric, which is a Geometric Deep Learning Extension Library for PyTorch. Please refer here for how to install and utilize the library.

Datasets

Graph classification benchmarks are publicly available at here.

This folder contains the following comma separated text files (replace DS by the name of the dataset):

n = total number of nodes

m = total number of edges

N = number of graphs

(1) DS_A.txt (m lines)

sparse (block diagonal) adjacency matrix for all graphs, each line corresponds to (row, col) resp. (nodeid, nodeid)

(2) DSgraphindicator.txt (n lines)

column vector of graph identifiers for all nodes of all graphs, the value in the i-th line is the graphid of the node with nodeid i

(3) DSgraphlabels.txt (N lines)

class labels for all graphs in the dataset, the value in the i-th line is the class label of the graph with graph_id i

(4) DSnodelabels.txt (n lines)

column vector of node labels, the value in the i-th line corresponds to the node with node_id i

There are OPTIONAL files if the respective information is available:

(5) DSedgelabels.txt (m lines; same size as DSAsparse.txt)

labels for the edges in DSAsparse.txt

(6) DSedgeattributes.txt (m lines; same size as DS_A.txt)

attributes for the edges in DS_A.txt

(7) DSnodeattributes.txt (n lines)

matrix of node attributes, the comma seperated values in the i-th line is the attribute vector of the node with node_id i

(8) DSgraphattributes.txt (N lines)

regression values for all graphs in the dataset, the value in the i-th line is the attribute of the graph with graph_id i

Run

To run HGP-SL, just execute the following command for graph classification task:

python main.py

Parameter Settings

| Datasets | lr | weightdecay | batchsize | poolratio | dropout | netlayers | | ------------- | --------- | -------------- | -------- | -------- | -------- | ---------- | | PROTEINS | 0.001 | 0.001 | 512 | 0.5 | 0.0 | 3 | | Mutagenicity | 0.001 | 0.001 | 512 | 0.8 | 0.0 | 3 | | NCI109 | 0.001 | 0.001 | 512 | 0.8 | 0.0 | 3 | | NCI1 | 0.001 | 0.001 | 512 | 0.8 | 0.0 | 3 | | DD | 0.0001 | 0.001 | 64 | 0.3 | 0.5 | 2 | | ENZYMES | 0.001 | 0.001 | 128 | 0.8 | 0.0 | 2 |

Citing

If you find HGP-SL useful for your research, please consider citing the following paper:

@article{zhang2019hierarchical,
  title={Hierarchical Graph Pooling with Structure Learning},
  author={Zhang, Zhen and Bu, Jiajun and Ester, Martin and Zhang, Jianfeng and Yao, Chengwei and Yu, Zhi and Wang, Can},
  journal={arXiv preprint arXiv:1911.05954},
  year={2019}
}

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.