A tensorflow implementation of GraphGAN (Graph Representation Learning with Generative Adversarial Nets)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea update README Jun 28, 2018
data/link_prediction update input data Jun 22, 2018
pre_train/link_prediction deleted: pre_train/link_prediction/CA-GrQc_dis_63272.emb Dec 8, 2017
src fix bugs Nov 6, 2018
.gitignore add framework.jpg Aug 16, 2018
README.md modify README Aug 16, 2018
framework.jpg add framework.jpg Aug 16, 2018



GraphGAN: Graph Representation Learning With Generative Adversarial Nets
Hongwei Wang, Jia Wang, Jialin Wang, Miao Zhao, Weinan Zhang, Fuzheng Zhang, Xing Xie, Minyi Guo
32nd AAAI Conference on Artificial Intelligence, 2018

GraphGAN unifies two schools of graph representation learning methodologies: generative methods and discriminative methods, via adversarial training in a minimax game. The generator is guided by the signals from the discriminator and improves its generating performance, while the discriminator is pushed by the generator to better distinguish ground truth from generated samples.

Files in the folder

  • data/: training and test data
  • pre_train/: pre-trained node embeddings

    Note: the dimension of pre-trained node embeddings should equal n_emb in src/GraphGAN/config.py

  • results/: evaluation results and the learned embeddings of the generator and the discriminator
  • src/: source codes


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

  • tensorflow == 1.8.0
  • tqdm == 4.23.4 (for displaying the progress bar)
  • numpy == 1.14.3
  • sklearn == 0.19.1

Input format

The input data should be an undirected graph in which node IDs start from 0 to N-1 (N is the number of nodes in the graph). Each line contains two node IDs indicating an edge in the graph.

txt file sample

0 1
3 2

Basic usage

mkdir cache
cd src/GraphGAN
python graph_gan.py