- Run
git clone --recurse-submodules https://github.com/gkswamy98/adversarial_rl.git
to clone with submodules andcd adversarial_rl
. - Run
pip install -e .
to install the main dependencies. - Run
mv baselines ../baselines
,cd ../baselines
, thenpip install -e . --user
to install our baselines fork.
- To train models, run
bash scripts/train.sh
.- To parallelize training runs, modify the training script to echo commands instead of executing them and run
bash ../scripts/train.sh | xargs -PN -ICMD /bin/bash -exc CMD
, replacing N with the number of cores available.
- To parallelize training runs, modify the training script to echo commands instead of executing them and run
- To attack trained models, run
bash scripts/attack.sh
.- Use the same trick as above to parallelize.
PPO, TRPO, A2C and DQN models trained on CartPole and Acrobot are in the models/
folder. Results of attacks are available in accompanying writeup.