Skip to content

hyunjin72/GraphGAN-PyTorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphGAN_pytorch

This repository is a PyTorch implementation of GraphGAN(arXiv).

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

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

Requirements

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

  • pytorch == 1.9.0
  • cuda == 10.2
  • tqdm == 4.62.3 (for displaying the progress bar)
  • numpy == 1.21.2
  • sklearn == 1.0.2

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

...

Usage

Create directories to store your result and cache file.

mkdir cache
mkdir results

Before training, you should modify the PATH in config.py.

# src/GraphGAN/config.py
PATH = "/home/[YOUR NAME]/GraphGAN_pytorch/src/"

Then, train and evaluate GraphGAN for link prediction:

python graph_gan.py

About

PyTorch implementation of GraphGAN

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages