@article{wang2022deep,
title={Deep Generative Model for Periodic Graphs},
author={Wang, Shiyu and Guo, Xiaojie and Zhao, Liang},
journal={arXiv preprint arXiv:2201.11932},
year={2022}
}
The code for PGD-VAE is adapted from the code of GRAN: Efficient graph generation with graph recurrent attention networks.
Running environment:
Python 3.9; PyTorch 1.8.1, networkx 2.5, scipy, numpy, pyyaml
Datasets
- Data: QMOF, MeshSeg and synthetic datasets have been processed and provided in the repository as:
- QMOF: MOFGraphs.p, MOFUnitCells.p
- MeshSeg: MeshSeqGraphs.p, MeshSegUnitCells.p
- Synthetic: SynGraphs.p, SynUnitCells.p
- To download the original datasets:
- Original QMOF data can be downloaded from here.
- Original MeshSeg data can be downloaded from here.
- Synthetic data is synthesized manually by the paper.
- The code to extract and generate data from original QMOF and MeshSeg datasets have been provided in the package as:
- QMOF: MOFDataGen.py
- MeshSeg: MeshSegDataGen.py
Arguments of code
- data = {synthetic, mesh, qmof}
- lr: learning rate
- epoch: epochs
- train = {True, False}
- eval = {True, False}
Training the model
To train the model using synthetic data and 100 epochs with learning rate of 0.001:
python train.py --data synthetic --train True --epoch 100 --lr 0.001
Note
- The trained model will be saved as "{data}_train.pt" in the working directory.
- The default dataset to be trained is the synthetic dataset. To train the model on another datasets please specify the dataset after
--data
argument.
- To train the model with different penalties on KL divergence terms, please manually modify the code in
model.py
, line 293.
Evaluating the model
To evaluate trained model:
python train.py --data synthetic --train False --eval True
Note:
- Functions for evaluation purpose are wrapped up in evaluation.py:
- compute_kld(): degree, cluster, orbit
- check_uniqueness(): uniqueness
- novelty_metric(): novelty