benedekrozemberczki / Appnp

Licence: gpl-3.0
A PyTorch implementation of "Predict then Propagate: Graph Neural Networks meet Personalized PageRank" (ICLR 2019).

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Appnp

Multihead Siamese Nets
Implementation of Siamese Neural Networks built upon multihead attention mechanism for text semantic similarity task.
Stars: ✭ 144 (-38.46%)
Mutual labels:  deep-neural-networks, attention
Time Attention
Implementation of RNN for Time Series prediction from the paper https://arxiv.org/abs/1704.02971
Stars: ✭ 52 (-77.78%)
Mutual labels:  deep-neural-networks, attention
Top 10 Computer Vision Papers 2020
A list of the top 10 computer vision papers in 2020 with video demos, articles, code and paper reference.
Stars: ✭ 132 (-43.59%)
Mutual labels:  research, deep-neural-networks
Hey Jetson
Deep Learning based Automatic Speech Recognition with attention for the Nvidia Jetson.
Stars: ✭ 161 (-31.2%)
Mutual labels:  deep-neural-networks, attention
Awesome Deep Learning Music
List of articles related to deep learning applied to music
Stars: ✭ 2,195 (+838.03%)
Mutual labels:  research, deep-neural-networks
Free Ai Resources
🚀 FREE AI Resources - 🎓 Courses, 👷 Jobs, 📝 Blogs, 🔬 AI Research, and many more - for everyone!
Stars: ✭ 192 (-17.95%)
Mutual labels:  research, deep-neural-networks
Orion
Asynchronous Distributed Hyperparameter Optimization.
Stars: ✭ 186 (-20.51%)
Mutual labels:  research, deep-neural-networks
Hnatt
Train and visualize Hierarchical Attention Networks
Stars: ✭ 192 (-17.95%)
Mutual labels:  deep-neural-networks, attention
Unofficial Implement Of Openpose
Implement of Openpose use Tensorflow
Stars: ✭ 222 (-5.13%)
Mutual labels:  deep-neural-networks
Snap N Eat
Food detection and recommendation with deep learning
Stars: ✭ 229 (-2.14%)
Mutual labels:  deep-neural-networks
Mindforger Repository
MindForger documentation repository.
Stars: ✭ 221 (-5.56%)
Mutual labels:  research
Pytorch Unet
Tunable U-Net implementation in PyTorch
Stars: ✭ 224 (-4.27%)
Mutual labels:  deep-neural-networks
Octconv.pytorch
PyTorch implementation of Octave Convolution with pre-trained Oct-ResNet and Oct-MobileNet models
Stars: ✭ 229 (-2.14%)
Mutual labels:  deep-neural-networks
Caffe2 Ios
Caffe2 on iOS Real-time Demo. Test with Your Own Model and Photos.
Stars: ✭ 221 (-5.56%)
Mutual labels:  deep-neural-networks
Pyconv
Pyramidal Convolution: Rethinking Convolutional Neural Networks for Visual Recognition (https://arxiv.org/pdf/2006.11538.pdf)
Stars: ✭ 231 (-1.28%)
Mutual labels:  deep-neural-networks
Zr Obp
Open Bandit Pipeline: a python library for bandit algorithms and off-policy evaluation
Stars: ✭ 219 (-6.41%)
Mutual labels:  research
Ml Workspace
Machine Learning (Beginners Hub), information(courses, books, cheat sheets, live sessions) related to machine learning, data science and python is available
Stars: ✭ 221 (-5.56%)
Mutual labels:  deep-neural-networks
Super Slomo
PyTorch implementation of Super SloMo by Jiang et al.
Stars: ✭ 2,714 (+1059.83%)
Mutual labels:  deep-neural-networks
Darkon
Toolkit to Hack Your Deep Learning Models
Stars: ✭ 231 (-1.28%)
Mutual labels:  deep-neural-networks
Deep Unet For Satellite Image Segmentation
Satellite Imagery Feature Detection with SpaceNet dataset using deep UNet
Stars: ✭ 227 (-2.99%)
Mutual labels:  deep-neural-networks

APPNP

Arxiv codebeat badge repo sizebenedekrozemberczki

An implementation of Predict then Propagate: Graph Neural Networks meet Personalized PageRank (ICLR 2019).

Abstract

Neural message passing algorithms for semi-supervised classification on graphs have recently achieved great success. However, these methods only consider nodes that are a few propagation steps away and the size of this utilized neighborhood cannot be easily extended. In this paper, we use the relationship between graph convolutional networks (GCN) and PageRank to derive an improved propagation scheme based on personalized PageRank. We utilize this propagation procedure to construct personalized propagation of neural predictions (PPNP) and its approximation, APPNP. Our model's training time is on par or faster and its number of parameters on par or lower than previous models. It leverages a large, adjustable neighborhood for classification and can be combined with any neural network. We show that this model outperforms several recently proposed methods for semi-supervised classification on multiple graphs in the most thorough study done so far for GCN-like models.

A PyTorch and Tensorflow implementation is awailable [here.].

This repository provides a PyTorch implementation of PPNP and APPNP as described in the paper:

Predict then Propagate: Graph Neural Networks meet Personalized PageRank. Johannes Klicpera, Aleksandar Bojchevski, Stephan Günnemann. ICLR, 2019. [Paper]

Requirements

The codebase is implemented in Python 3.5.2. package versions used for development are just below.

networkx          2.4
tqdm              4.28.1
numpy             1.15.4
pandas            0.23.4
texttable         1.5.0
scipy             1.1.0
argparse          1.1.0
torch             1.1.0
torch-scatter     1.4.0
torch-sparse      0.4.3
torch-cluster     1.4.5
torch-geometric   1.3.2
torchvision       0.3.0

Datasets

The code takes the **edge list** of the graph in a csv file. Every row indicates an edge between two nodes separated by a comma. The first row is a header. Nodes should be indexed starting with 0. A sample graph for `Cora` is included in the `input/` directory. In addition to the edgelist there is a JSON file with the sparse features and a csv with the target variable.

The **feature matrix** is a sparse binary one it is stored as a json. Nodes are keys of the json and feature indices are the values. For each node feature column ids are stored as elements of a list. The feature matrix is structured as:

{ 0: [0, 1, 38, 1968, 2000, 52727],
  1: [10000, 20, 3],
  2: [],
  ...
  n: [2018, 10000]}

The target vector is a csv with two columns and headers, the first contains the node identifiers the second the targets. This csv is sorted by node identifiers and the target column contains the class meberships indexed from zero.

NODE ID Target
0 3
1 1
2 0
3 1
... ...
n 3

Options

Training an APPNP/PPNP model is handled by the src/main.py script which provides the following command line arguments.

Input and output options

  --edge-path       STR    Edge list csv.         Default is `input/cora_edges.csv`.
  --features-path   STR    Features json.         Default is `input/cora_features.json`.
  --target-path     STR    Target classes csv.    Default is `input/cora_target.csv`.

Model options

  --seed              INT     Random seed.                   Defailt is 42.
  --model             STR     Model exact or approximate.    Default is `exact`.
  --iterations        INT     APP iterations.                Default is 10.
  --alpha             FLOAT   Teleport parameter.            Default is 0.1
  --epochs            INT     Number of training epochs.     Default is 2000.
  --early-stopping    INT     Early stopping rounds.         Default is 5.
  --training-size     INT     Training set size.             Default is 1500.
  --test-size         INT     Test set size.                 Default is 500.
  --learning-rate     FLOAT   Adam learning rate.            Default is 0.01
  --dropout           FLOAT   Dropout rate value.            Default is 0.5
  --lambd             FLOAT   Rgularization parameter.       Default is 0.005.
  --layers            LST     Layer sizes in first layers.   Default is [64, 64]. 

Examples

The following commands learn a neural network and score on the test set. Training a model on the default dataset.

python src/main.py

Training a PPNP model for a 100 epochs.

python src/main.py --epochs 100

Training an APPNP model.

python src/main.py --model approximate

Increasing the learning rate and the dropout.

python src/main.py --learning-rate 0.1 --dropout 0.9

License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].