Experiments for the paper DENN, Handling Black Swan Events in Deep Learning with Diversely Extrapolated Neural Networks, published at IJCAI 2020.
Feel free to contact me if you want me to send the .h5 versions of the imitation datasets.
- The
.sh
files to train the different models are available inexec/
for each experiment. - The figures can be generates using the Jupyter notebooks.
- The datasets need to be downloaded first.
- The figures can be generated using the Jupyter notebook.
- To train the models, use the files in this order for each model:
- train_reference.sh
- train_denn.sh
- compute_stats_denn.sh
- train_ensemble.sh
- compute_stats_ensemble.sh
- train_prior.sh
- compute_stats_prior.sh
- train_anchoring.sh
- compute_stats_anchoring.sh
- train_oe.sh
- compute_stats_oe.sh
Note: the different methods were adapted to fit the same common framework (same optimizer, same repulsive frames) and compare the additional term in the loss that they provide.
Repository #1: https://github.com/sanjaythakur/trpo Repository #2: https://github.com/sanjaythakur/Multiple_Task_MuJoCo_Domains
- Train a PPO agent on Reacher-v1 using the code and default parameters available at Repository #1
The trained agent is saved in folder
saved_models/
./train.py Reacher-v1 -n 60000 -b 50
- To create the datasets, you first need to modify the xml files in MuJoCo defining modifying the Reacher environment.
Follow the instructions given in the Repository #2 above and the prepared xml files in
src/
. You should find the xml files in:envs/YOUR_ENV_NAME/lib/python3.7/site-packages/gym/envs/mujoco/assets/
Then, create trajectories datasets (a graphic interface is required, ssh is NOT enough), launch:python px_color_create_trajs.py —color red —shape sphere
- To train a reference function on the chosen dataset, launch:
bash exec/train_reference.sh
. Note: modify the dataset to use in the.sh
file. - To train the ensemble, launch:
bash exec/train_ensemble.sh
. Note: modify the dataset to use in the.sh
file. - To train DENN, launch:
bash exec/train_denn.sh
. Note: modify the datasets to use in the.sh
file. - To compute statistics and generate the figures, use the
.sh
files inexec/
. Use the--final
flag to compute stats on the test set rather than the validation set. - To generate the figures, use the Jupyter notebook