Code for SymNet3.0: Exploiting Long-Range Influences in Learning Generalized Neural Policies for Relational MDPs, UAI 2023(link)
Please download datasets and instances from here into the main folder and unzip it.
- python3
- tensorflow=2.0
- unittest
- multiprocessing
- threading
- shutil
- better_exceptions
- pickle
- networkx
- scipy
- tqdm
- pandas
- numpy
To run an experiment, set parameters in my_config.py. The important ones are the 'domain', 'mode', 'model_dir' and 'setting'. To train a model, just run:
python train.py
This file both trains and validates models. The best model is stored in the checkpoints/ subfolder of the model folder. The meta_logging.csv file shows reward progress across training.
To run inference on the best model, just run:
python test.py
This will generate a file results.csv in the model folder which will contain rewards obtained by the best model.
Parameters can be set in two files in multi_train/deep_plan:
- my_config.py
- symnet3_config.py
The most important parameters are:
- mode: This sets the training setting and architecture. Use "no_dist" for SymNet2.0, "kl" for SymNet3.0+KL, "no_kl" for SymNet3.0-KL and "kl_decay" for SymNet3+KL_{decay}
- setting: This sets the instances to be used for training. "lr" uses the Long Range instances and "ippc" uses the IPPC instances. The instances used for training are given in train.py.
- data/ contains trajectory data generated by PROST and the generators used for instance generation.
- gym/ contains code for initializing and simulating RDDL environments.
- rddl/ contains all the instance files along with their DBN .dot files and parsed files.
- utils/ contains code for extracting. instance graph and generating other utilities for all the environments.
- spektral/ contains code used for GATs and the Influence Layer.
- multi_train/ contains code for training and evaluation.
- multi_train/deep_plan/networks contains code for the architecture.
Feel free to contact the authors if you run into issues.