The code has been tested over PyTorch 1.8.0 version with Python 3.7.0.
Change cuda version as per your GPU hardware support.
pip install -r requirements.txt
Boost (Version >= 1.70.0) and OpenMP are required for compling C++ binaries. Run build.sh
script in the project's root directory.
./build.sh
python meta_main_n.py leukemia
: Training GShot Meta-Modelpython tune_main_n.py leukemia
: Fine-Tuning GShot for Leukemiapython evaluate_n.py leukemia
: Evaluation on Leukemia
Here leukemia is the name of the config file present in configs/
folder.
For AIDS-ca:aids_ca
, Enzyme: enzyme
, Spring: spring
.
meta_main_n.py
is the main script file of GShot, and specific arguments are set in configs/<Config_Filename>
tune_main_n.py
is the fine-tuning script file of GShot and specific arguments are set in configs/<Config_Filename>
train.py
model specific training files.datasets/preprocess.py
andutil.py
contain dataset processing functions.datasets/process_dataset.py
reads graphs from different data formats.
dfscode/dfs_code.cpp
calculates the minimum DFS code.dfscode/dfs_wrapper.py
is a python wrapper for the cpp file.
- Configuration: Dataset specific parameters are present in configs/
<Config_Filename>
- All the input arguments and hyper parameters setting are included in
base_args.py
. - Dataset specific arguments which override the default arguments of
base_args.py
are present in configs folder. - See the documentation in
base_args.py
for more detailed descriptions.
base_args.py
contains parameters to specify where the default directory etc. should be
tensorboard/
contains tensorboard event objects which can be used to view training and validation graphs in real time.model_save/
stores the model checkpointstmp/
stores all the temporary files generated during training and evaluation.
-
evaluate_n.py
: File to compute metrics between generated graphs and graphs from original dataset. -
We use GraphRNN implementation for structural metrics.
python main_n.py aids_ca_single
Training GraphGen on AIDS-CA datasetpython evaluate_n.py aids_ca_single
Evaluating GraphGen on AIDS-CA dataset
python main_n.py aids_ca_single-grnn
Training GraphRNN on AIDS-CA datasetpython evaluate_n.py aids_ca_single-grnn
Evaluating GraphRNN on AIDS-CA dataset
python multi_main_n.py aids_ca_multi
Training PreTrain GraphGenpython tune_main_n.py aids_ca_multi
Fine-Tuning PreTrained GraphGen on AIDS-CA datasetpython evaluate_n.py aids_ca_multi
Evaluating PreTrain GraphGen on AIDS-CA dataset