December 20, 2018

336 words 2 mins read



Implementation of Graph Auto-Encoders in TensorFlow

repo name tkipf/gae
repo link
language Python
size (curr.) 5216 kB
stars (curr.) 924
created 2017-06-21
license MIT License

Graph Auto-Encoders

This is a TensorFlow implementation of the (Variational) Graph Auto-Encoder model as described in our paper:

T. N. Kipf, M. Welling, Variational Graph Auto-Encoders, NIPS Workshop on Bayesian Deep Learning (2016)

Graph Auto-Encoders (GAEs) are end-to-end trainable neural network models for unsupervised learning, clustering and link prediction on graphs.

(Variational) Graph Auto-Encoder

GAEs have successfully been used for:

GAEs are based on Graph Convolutional Networks (GCNs), a recent class of models for end-to-end (semi-)supervised learning on graphs:

T. N. Kipf, M. Welling, Semi-Supervised Classification with Graph Convolutional Networks, ICLR (2017).

A high-level introduction is given in our blog post:

Thomas Kipf, Graph Convolutional Networks (2016)


python install


  • TensorFlow (1.0 or later)
  • python 2.7
  • networkx
  • scikit-learn
  • scipy

Run the demo



In order to use your own data, you have to provide

  • an N by N adjacency matrix (N is the number of nodes), and
  • an N by D feature matrix (D is the number of features per node) – optional

Have a look at the load_data() function in for an example.

In this example, we load citation network data (Cora, Citeseer or Pubmed). The original datasets can be found here: and here (in a different format):

You can specify a dataset as follows:

python --dataset citeseer

(or by editing


You can choose between the following models:

  • gcn_ae: Graph Auto-Encoder (with GCN encoder)
  • gcn_vae: Variational Graph Auto-Encoder (with GCN encoder)


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

  title={Variational Graph Auto-Encoders},
  author={Kipf, Thomas N and Welling, Max},
  journal={NIPS Workshop on Bayesian Deep Learning},
comments powered by Disqus