This is the source code for our ICLR2021 paper: Adaptive Universal Generalized PageRank Graph Neural Network.

Related tags

Deep Learning GPRGNN
Overview

GPRGNN

This is the source code for our ICLR2021 paper: Adaptive Universal Generalized PageRank Graph Neural Network.

Hidden state feature extraction is performed by a neural networks using individual node features propagated via GPR. Note that both the GPR weights and parameter set of the neural network are learned simultaneously in an end-to-end fashion (as indicated in red).

The learnt GPR weights of the GPR-GNN on real world datasets. Cora is homophilic while Texas is heterophilic (Here, H stands for the level of homophily defined in the main text, Equation (1)). An interesting trend may be observed: For the heterophilic case the weights alternate from positive to negative with dampening amplitudes. The shaded region corresponds to a 95% confidence interval.

Requirement:

pytorch
pytorch-geometric
numpy

Run experiment with Cora:

go to folder src

python train_model.py --RPMAX 2 \
        --net GPRGNN \
        --train_rate 0.025 \
        --val_rate 0.025 \
        --dataset cora 

Create cSBM dataset:

go to folder src

source create_cSBM_dataset.sh

The total size of cSBM datasets we used is over 1GB hence they are not included in this repository, but we do have a sample of the dataset in data/cSBM_demo. We reccommend you to regenerate these datasets using the format of above script, start its name with 'cSBM_data' and change the parameter to what we choose in section A.10 in Appendix of our paper.

Repreduce results in Table 2:

To reproduce the results in Table 2 of our paper you need to first perform hyperparameter tuning. For details of optimization of all models, please refer to section A.9 in Appendix of our paper. Here are the settings for GPRGNN and APPNP:

We choose random walk path lengths with K = 10 and use a 2-layer (MLP) with 64 hidden units for the NN component. For the GPR weights, we use different initializations including PPR with , or and the default random initialization in pytorch. Similarly, for APPNP we search the optimal . For other hyperparameter tuning, we optimize the learning rate over {0.002, 0.01, 0.05} and weight decay {0.0, 0.0005} for all models.

Here is a list of hyperparameters for your reference:

  • For cora and citeseer, choosing different alpha doesn't make big difference. So you can choose alpha = 0.1.
  • For pubmed, we choose lr = 0.05, alpha = 0.2, wd = 0.0005 and add dprate = 0.5 (dropout for GPR part).
  • For computers, we choose lr = 0.05, alpha = 0.5 and wd = 0.
  • For Photo, we choose lr = 0.01, alpha = 0.5 and wd = 0.
  • For chameleon, we choose lr = 0.05, alpha = 1, wd = 0 and dprate = 0.7.
  • For Actor, we choose lr = 0.01, alpha = 0.9, wd = 0.
  • For squirrel, we choose lr = 0.05, alpha = 0, wd = 0, dprate = 0.7.
  • For Texas, we choose lr = 0.05, alpha = 1, wd = 0.0005.
  • For Cornell, we choose lr = 0.05, alpha = 0.9, wd = 0.0005.

Citation

Please cite our paper if you use this code in your own work:

@inproceedings{
chien2021adaptive,
title={Adaptive Universal Generalized PageRank Graph Neural Network},
author={Eli Chien and Jianhao Peng and Pan Li and Olgica Milenkovic},
booktitle={International Conference on Learning Representations},
year={2021},
url={https://openreview.net/forum?id=n6jl7fLxrP}
}

Feel free to email us([email protected], [email protected]) if you have any further questions.

Comments
  • About what cSBM parameters to use

    About what cSBM parameters to use

    In the Appendix A.5 of the paper, it is stated that n=5000 and f=2000. However, create_cSBM_dataset.sh set n=800 and f=1000. Which set of parameters should I use?

    Also, I was not able to find what average degree was used in the paper. Should I just set it to 5 as in create_cSBM_dataset.sh? Thanks.

    opened by Xiuyu-Li 6
  • Fix:

    Fix: "RuntimeError: The 'data' object was created by an older version of PyG"?

    I met the same issue as https://github.com/jianhao2016/GPRGNN/issues/11#issue-1074005931. I wonder if it's useful to fix this issue by using the new api of pyg instead of the code in dataset_utils.py? Since I'm a newcomer, I don't know whether the new dataset downloaded from pyg is equivalent to your dataset.

    I ran the dataset of chameleon, squirrel and film and my environment is:

    • numpy==1.20.2
    • torch==1.9.0+cu111
    • torch_geometric==2.0.3
    • torch_sparse==0.6.12
    • tqdm==4.62.3
    opened by warpmatrix 5
  • RuntimeError: The 'data' object was created by an older version of PyG. If this error occurred while loading an already existing dataset, remove the 'processed/' directory in the dataset's root folder and try again.

    RuntimeError: The 'data' object was created by an older version of PyG. If this error occurred while loading an already existing dataset, remove the 'processed/' directory in the dataset's root folder and try again.

    Dear authors,

    Thank you for this awesome work. I found the provided examples are very clear. However, I found the following error when I ran the Film Chameleon and Squirrel datasets.

    “RuntimeError: The 'data' object was created by an older version of PyG. If this error occurred while loading an already existing dataset, remove the 'processed/' directory in the dataset's root folder and try again.”

    After removing 'processed' as prompted, I run it again to report the same error. Do you have any idea to deal with this problem?

    Thank you.

    good first issue 
    opened by xihongyang1999 5
  • Why can't I reproduce the baseline results in Table 2?

    Why can't I reproduce the baseline results in Table 2?

    When I try to reproduce the baseline results use your code, I have some problems. eg. GAT.

    I have tried lr={0.002, 0.01, 0.05} and wd={0.0, 0.0005} , but the best test acc I got in datasets 'squirrel' is 29.9328 ± 0.8234. In your paper, it is 42.72±0.33. For other models and heterophily datasets, same things happened.

    PS: for GAT & squirrel, all hyperparameters are (hidden=64, dropout=0.5, train_rate=0.6, val_rate=0.2, heads=8, output_heads=1)

    opened by jayeew 3
  • Missing chameleon, squirrel, and film datasets

    Missing chameleon, squirrel, and film datasets

    Hi, It seems like currently there are no processed chameleon, squirrel, and film datasets in the repo, and related experiments could not be directly run.

    Also, what are the differences between the dataset_heterophily and WebKB class? I managed to run those datasets by directly modifying the WebKB class using the downloaded raw files from the Geom-GCN repo (film dataset is processed acccording to their code):

    data = f.read().split('\n')[1:-1]
    if self.name == 'film':
        x = []
        for r in data:
            feat_one_hot = np.zeros(932)
            feat_one_hot[[int(v) for v in r.split('\t')[1].split(',')]] = 1
            x.append(feat_one_hot)
    else:
        x = [[float(v) for v in r.split('\t')[1].split(',')] for r in data]
    x = torch.tensor(x, dtype=torch.float)
    

    Does the dataset_heterophily class process the raw files differently from what I have done? Thank you!

    opened by Xiuyu-Li 3
  • Test Std

    Test Std

    I reproduced the experiment on Texas and Chameleon, however, I found that the test accuracy matched the results in your paper, but the test std could not match your paper. The test std on Texas is 0.61 in your paper, but 3.05 in my experiment. I haven't change any code, but only run the Reproduce_GPRGNN.sh. I'm wondering what may contribute to this difference, could you please answer my question, thanks!

    opened by wendioooo 2
  • Graph Spectral Coefficient Initialization

    Graph Spectral Coefficient Initialization

    Hi, I noticed that the coefficient of the K-th order term is initialized in a way that is different from others. In one of my experiments, the learned coefficient of the K-th order term thus is much larger than others (alpha=0.1). Could you tell me why this is needed? Thanks!

    https://github.com/jianhao2016/GPRGNN/blob/dc246833865af87ae5d4e965d189608f8832ddac/src/GNN_models.py#L36

    opened by joneswong 2
  • What's WS init?

    What's WS init?

    In your code, there 5 different init modes. What's WS init? Could you explain how to use this mode? More specifically, how to determine the gamma in this mode? Screen Shot 2021-12-13 at 20 35 03

    opened by hazdzz 1
  • About gamma initialization

    About gamma initialization

    In your code, you use zero init for TEMP first, then replace elements in TEMP. I have confused about this operation. Why do you raplace elements in initialized tensor by fixed parameters?

    Screen Shot 2021-10-21 at 20 59 27
    opened by hazdzz 1
  • Question about theorem 4.2

    Question about theorem 4.2

    For theorem 4.2: If the gradients of the gammas have the same sign for some k', why does that imply that the magnitude of the gammas approaches 0 for k >= k' when oversmoothing happens?

    For theorem A.1: You mention the following: Screenshot from 2021-09-26 17-23-32 But in the example you mention with Kronecker delta, it seems like inequality (a) does not hold, since you would get 1 for |lambda|^0 = 1 on the LHS and |lambda|^1 < 1 on RHS. If lambda is equal to 1, then sure, this works. But it seems like your initial goal was to show: Screenshot from 2021-09-26 17-27-11

    opened by mdanb 1
  • About reproducing the cSBM datasets

    About reproducing the cSBM datasets

    Hi jianhao, I noticed that the avg_degree is set to be 5 in create_cSBM_dataset.sh. However, I cannot figure out what is the value of avg_degree used in your paper. If we want to reproduce the cSBM datasets used in your paper exactly, how about

    phis=(-1.0 -0.75 -0.5 -0.25 0.0 0.25 0.5 0.75 1.0)
    for (( i=0; i<${#phis[@]}; i++ ))
    do
      python cSBM_dataset.py --phi ${phis[$i]} \
          --name cSBM_phi_${phis[$i]} \
          --root ../data/ \
          --num_nodes 5000 \
          --num_features 2000 \
          --avg_degree 5 \
          --epsilon 3.25 \
          --train_percent 0.025 \
    done
    
    (I supplemented the argument `train_percent` accordingly, but the dense splits needs to modify your utility code snippets)
    opened by joneswong 1
Owner
Jianhao
Jianhao
ICLR2021 (Under Review)

Self-Supervised Time Series Representation Learning by Inter-Intra Relational Reasoning This repository contains the official PyTorch implementation o

Haoyi Fan 58 Dec 30, 2022
[ICLR2021] Unlearnable Examples: Making Personal Data Unexploitable

Unlearnable Examples Code for ICLR2021 Spotlight Paper "Unlearnable Examples: Making Personal Data Unexploitable " by Hanxun Huang, Xingjun Ma, Sarah

Hanxun Huang 98 Dec 7, 2022
Official public repository of paper "Intention Adaptive Graph Neural Network for Category-Aware Session-Based Recommendation"

Intention Adaptive Graph Neural Network (IAGNN) This is the official repository of paper Intention Adaptive Graph Neural Network for Category-Aware Se

null 9 Nov 22, 2022
code for ICCV 2021 paper 'Generalized Source-free Domain Adaptation'

G-SFDA Code (based on pytorch 1.3) for our ICCV 2021 paper 'Generalized Source-free Domain Adaptation'. [project] [paper]. Dataset preparing Download

Shiqi Yang 84 Dec 26, 2022
The source code of the paper "Understanding Graph Neural Networks from Graph Signal Denoising Perspectives"

GSDN-F and GSDN-EF This repository provides a reference implementation of GSDN-F and GSDN-EF as described in the paper "Understanding Graph Neural Net

Guoji Fu 18 Nov 14, 2022
This is an open-source toolkit for Heterogeneous Graph Neural Network(OpenHGNN) based on DGL [Deep Graph Library] and PyTorch.

This is an open-source toolkit for Heterogeneous Graph Neural Network(OpenHGNN) based on DGL [Deep Graph Library] and PyTorch.

BUPT GAMMA Lab 519 Jan 2, 2023
The source code of the paper "SHGNN: Structure-Aware Heterogeneous Graph Neural Network"

SHGNN: Structure-Aware Heterogeneous Graph Neural Network The source code and dataset of the paper: SHGNN: Structure-Aware Heterogeneous Graph Neural

Wentao Xu 7 Nov 13, 2022
Convolutional neural network web app trained to track our infant’s sleep schedule using our Google Nest camera.

Machine Learning Sleep Schedule Tracker What is it? Convolutional neural network web app trained to track our infant’s sleep schedule using our Google

g-parki 7 Jul 15, 2022
[WWW 2021] Source code for "Graph Contrastive Learning with Adaptive Augmentation"

GCA Source code for Graph Contrastive Learning with Adaptive Augmentation (WWW 2021) For example, to run GCA-Degree under WikiCS, execute: python trai

Big Data and Multi-modal Computing Group, CRIPAC 97 Jan 7, 2023
Code for our paper Domain Adaptive Semantic Segmentation with Self-Supervised Depth Estimation

CorDA Code for our paper Domain Adaptive Semantic Segmentation with Self-Supervised Depth Estimation Prerequisite Please create and activate the follo

Qin Wang 60 Nov 30, 2022
Code for our EMNLP 2021 paper “Heterogeneous Graph Neural Networks for Keyphrase Generation”

GATER This repository contains the code for our EMNLP 2021 paper “Heterogeneous Graph Neural Networks for Keyphrase Generation”. Our implementation is

Jiacheng Ye 12 Nov 24, 2022
A weakly-supervised scene graph generation codebase. The implementation of our CVPR2021 paper ``Linguistic Structures as Weak Supervision for Visual Scene Graph Generation''

README.md shall be finished soon. WSSGG 0 Overview 1 Installation 1.1 Faster-RCNN 1.2 Language Parser 1.3 GloVe Embeddings 2 Settings 2.1 VG-GT-Graph

Keren Ye 35 Nov 20, 2022
Source Code for our paper: Understand me, if you refer to Aspect Knowledge: Knowledge-aware Gated Recurrent Memory Network

KaGRMN-DSG_ABSA This repository contains the PyTorch source Code for our paper: Understand me, if you refer to Aspect Knowledge: Knowledge-aware Gated

XingBowen 4 May 20, 2022
Some code of the implements of Geological Modeling Using 3D Pixel-Adaptive and Deformable Convolutional Neural Network

3D-GMPDCNN Geological Modeling Using 3D Pixel-Adaptive and Deformable Convolutional Neural Network PyTorch implementation of "Geological Modeling Usin

null 5 Nov 21, 2022
Source for the paper "Universal Activation Function for machine learning"

Universal Activation Function Tensorflow and Pytorch source code for the paper Yuen, Brosnan, Minh Tu Hoang, Xiaodai Dong, and Tao Lu. "Universal acti

null 4 Dec 3, 2022
Source code for paper "Document-Level Relation Extraction with Adaptive Thresholding and Localized Context Pooling", AAAI 2021

ATLOP Code for AAAI 2021 paper Document-Level Relation Extraction with Adaptive Thresholding and Localized Context Pooling. If you make use of this co

Wenxuan Zhou 146 Nov 29, 2022
Source code of the paper Meta-learning with an Adaptive Task Scheduler.

ATS About Source code of the paper Meta-learning with an Adaptive Task Scheduler. If you find this repository useful in your research, please cite the

Huaxiu Yao 16 Dec 26, 2022