• Stars
    star
    2,983
  • Rank 15,009 (Top 0.3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Graph Attention Networks (https://arxiv.org/abs/1710.10903)

GAT

Graph Attention Networks (Veličković et al., ICLR 2018): https://arxiv.org/abs/1710.10903

GAT layer t-SNE + Attention coefficients on Cora

Overview

Here we provide the implementation of a Graph Attention Network (GAT) layer in TensorFlow, along with a minimal execution example (on the Cora dataset). The repository is organised as follows:

  • data/ contains the necessary dataset files for Cora;
  • models/ contains the implementation of the GAT network (gat.py);
  • pre_trained/ contains a pre-trained Cora model (achieving 84.4% accuracy on the test set);
  • utils/ contains:
    • an implementation of an attention head, along with an experimental sparse version (layers.py);
    • preprocessing subroutines (process.py);
    • preprocessing utilities for the PPI benchmark (process_ppi.py).

Finally, execute_cora.py puts all of the above together and may be used to execute a full training run on Cora.

Sparse version

An experimental sparse version is also available, working only when the batch size is equal to 1. The sparse model may be found at models/sp_gat.py.

You may execute a full training run of the sparse model on Cora through execute_cora_sparse.py.

Dependencies

The script has been tested running under Python 3.5.2, with the following packages installed (along with their dependencies):

  • numpy==1.14.1
  • scipy==1.0.0
  • networkx==2.1
  • tensorflow-gpu==1.6.0

In addition, CUDA 9.0 and cuDNN 7 have been used.

Reference

If you make advantage of the GAT model in your research, please cite the following in your manuscript:

@article{
  velickovic2018graph,
  title="{Graph Attention Networks}",
  author={Veli{\v{c}}kovi{\'{c}}, Petar and Cucurull, Guillem and Casanova, Arantxa and Romero, Adriana and Li{\`{o}}, Pietro and Bengio, Yoshua},
  journal={International Conference on Learning Representations},
  year={2018},
  url={https://openreview.net/forum?id=rJXMpikCZ},
  note={accepted as poster},
}

For getting started with GATs, as well as graph representation learning in general, we highly recommend the pytorch-GAT repository by Aleksa Gordić. It ships with an inductive (PPI) example as well.

GAT is a popular method for graph representation learning, with optimised implementations within virtually all standard GRL libraries:

We recommend using either one of those (depending on your favoured framework), as their implementations have been more readily battle-tested.

Early on post-release, two unofficial ports of the GAT model to various frameworks quickly surfaced. To honour the effort of their developers as early adopters of the GAT layer, we leave pointers to them here.

License

MIT

More Repositories

1

TikZ

Complete collection of my PGF/TikZ figures.
TeX
1,067
star
2

Algorithms

Several algorithms and data structures implemented in C++ by me (credited to others where necessary).
C++
626
star
3

DGI

Deep Graph Infomax (https://arxiv.org/abs/1809.10341)
Python
591
star
4

facejack

your face has been hijacked
Python
23
star
5

muxstep

An open-source C++ multiplex HMM library for making inferences on multiple data types
C++
12
star
6

X-CNN

Cross-modal convolutional neural networks
Python
11
star
7

Simplex-TSP-Solver

Iterative exact solver of the Travelling Salesman Problem, taking advantage of the Simplex Algorithm (by methods of Dantzig, Fulkerson and Johnson)
C++
11
star
8

Machine-Learning

My personal machine learning algorithms repository, implemented in C++.
C++
10
star
9

deepmersion

own your surroundings
Python
9
star
10

deep-lossy-fun

Accompanying demos for my TCES talk on loss function engineering
Python
8
star
11

gp

Simple C++ library for Gaussian process regression
C++
7
star
12

HashCode2017

HC2017 Qualification Round: Team МЕТАШСА (Ranked 53rd)
C++
4
star
13

telesign

Python
3
star
14

CSTII-Ariana

My final-year project for Part II of the Computer Science Tripos, as originally submitted.
C++
3
star
15

Curriculum-Vitae

The latest version of my CV (with matching cover letter), powered by LaTeX and TikZ.
TeX
3
star
16

CSTIB-Ticks

My codes written for the assessed programming exercises ("ticks") in Part IB of the Computer Science Tripos.
Java
1
star
17

a-trip-down-lstm-lane

Textual generation using character LSTMs
PostScript
1
star
18

CSTIA-Ticks

My codes written for the assessed programming exercises ("ticks") in part IA of the Computer Science Tripos.
Java
1
star
19

HashCode2017Finals

HC2017 Finals: Team МЕТАШСА (Ranked 5th)
C++
1
star
20

advent-of-kotlin

My solutions to Advent of Code 2019 challenges, written in Kotlin.
1
star
21

advent-of-rust

My solutions to Advent of Code challenges, written in Rust.
Rust
1
star
22

jitter

A mixture model for representing a doubly-categorical set of discrepancy types
C++
1
star
23

viral

you're infected
Java
1
star
24

n-hance-pls

Neural networks make your smartphone videos better... after you've filmed them
HTML
1
star