DRAGEN - Distributionally Robust Policy Learning via Adversarial Environment Generation
This repository includes codes for synthetic trainings of the two robotic tasks in the paper:
- Swinging up a pendulum with onboard vision
- Grasping realistic 2D/3D grasping
Although the codes for all experiments are included here, we only provide instructions for re-producing pendulum experiments here. Re-producing grasping experiments relies on several custom packages (SDF sampling, mesh processing, off-screen rendering) that requires careful installation; we are happy to provide instructions upon further request (but would be difficult to keep anonymity). We do provide the instructions for running grasping policy training in 2D setting (with PyBullet simulation).
Dependencies:
pip install
with python=3.7/3.8: pybullet, Pillow, torch, torchvision, gym, psutil, python-mnist, h5py, pyyaml, perlin_noise (pendulum baseline); shapely, trimesh (grasping)
pip install -e .
to install locally: rlpyt folder included in the supplementary materials, which is a custom fork of rlpyt library for SAC training. Running pendulum experiments requires a GPU.
File naming:
ae
is for DRAGEN training; dr
is for baselines (noise, domain randomization, etc).
Running pendulum experiments:
- (For Digit) install and download MNIST dataset here and download USPS dataset here; (for Urban) download Apollo Synthetic dataset here.
- Generate Landmark/Digit/Urban images by running
generate_landmark.py
andprocess_mnist/usps/apollo.py
. - Specify dataset paths in provided config files.
- Run
python run_pen_ae.py {config filename}
, orpython run_pen_dr.py {config filename}
for baselines.
Running grasping policy training in 2D setting:
- Generate training and testing objects by running
generate_2d_shapes.py
. - Specify object path in
train_grasp.py
and run it.