xiangsheng1325 / netgan_pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NetGAN: Generating Graphs via Random Walks

Pytorch implementation of the method proposed in the paper: NetGAN: Generating Graphs via Random Walks
based on the tensorflow implementation: https://github.com/danielzuegner/netgan
There are two folders "netgan" and "netgan_modified". The first folder is the normal netgan implementation. It contains four different python files training.py, models.py, utils.py and demo_pytorch.ipynb. training.py is the main file. With this file you can train a graph and generate synthetic graphs afterwards. models.py contains the generator and the discriminator. utils.py has usefull functions and the demo_pytorch.ipynb is a demo version where training in done on the cora dataset. For better understanding the architectures of the models are shown as images below. The hyperparameters are defined respectively.

The folder "netgan_modified" is a modifed version of netgan. The generator has changed as the bottom picture shows. With the additional LSTM it is possible to generate graphs with an additional feature. demo_pytorch.ipynb is an example where synthetic graphs are created from an electrical grid. The structure and the conduction length are generated. branch.csv and bus.csv contain information from different electircal grids. They are created from https://electricgrids.engr.tamu.edu/electric-grid-test-cases/

How GANs work:

GAN

Generator model:

Generator

Discriminator model:

Discriminator

Generator model expanded with conductor length

Generator_expanded

About


Languages

Language:Jupyter Notebook 99.2%Language:Python 0.8%