Coder Social home page Coder Social logo

irom-lab / pac-imitation Goto Github PK

View Code? Open in Web Editor NEW
11.0 10.0 0.0 3.86 MB

Code for Generalization Guarantees for (Multi-Modal) Imitation Learning

Home Page: https://arxiv.org/abs/2008.01913

License: MIT License

Python 99.87% CMake 0.13%
generalization pac-bayes grasping pushing navigation cvae imitation-learning franka-panda multi-modal

pac-imitation's Introduction

Generalization Guarantees for (Multi-Modal) Imitation Learning

Paper | Review | Experiment video | 5min presentation at CoRL 2020

Watch the video

This repository includes codes for synthetic trainings of these robotic tasks in the paper:

  1. Grasping diverse mugs
  2. Planar box pushing using visual-feedback
  3. Vision-based navigation through home environments

Although the codes for all examples are included here, only the pushing example can be run without any additional codes/resources. The other two examples require data from online object dataset and object post-processing, which can take significant amount of time to set up and involves licensing. Meanwhile, all objects (rectangular boxes) used for the pushing example can be generated through URDF files (generativeBox.py).

Moreover, we provide the pre-trained weights for the decoder network of the cVAE for the pushing example. The posterior policy distribution can be trained then using the weights and the prior distribution (unit Gaussians).

Dependencies (pip install with python=3.7):

  1. pybullet
  2. torch
  3. ray
  4. cvxpy

File naming:

  • ..._bc.py is for behavioral cloning training using collected demonstrations.
  • ..._es.py is for PAC-Bayes ``fine-tuning'' using Natural Evolutionary Strategies. Also computes the final bound at the end of training.
  • ..._bound.py is for computing the final bound.

Running the pushing example:

  1. Generate a large number (3000) of boxes by running python generateBox.py --obj_folder=... and specifying the path to the object URDF files generated.
  2. Modify obj_folder in push_pac_easy.json and push_pac_hard.json
  3. Train pushing tasks ("Easy" or "Hard" difficulty) by running python trainPush_es.py push_pac_easy (or hard). The final bound is also computed by specifying L (number of policies sampled for each environment for computing the sample convergence bound) in the json file. (Note: the default number of training environments is 1000 as in the json files. With num_cpus=20 on a moderately powerful desktop, it takes 20 minutes for each training step. We recommend training using Amazon AWS instance c5.24xlarge that has 96 threads. Also, a useful final bound requires large L and can take significant computations.)
  4. Visualize pushing rollout by running python testPushRollout.py --obj_folder=... --posterior_path=.... If posterior_path is not provided, the prior policy distribution (unit Gaussians) is used. Otherwise, the path should be push_result/push_pac_easy/train_details (or hard).

Future release

  1. Provide the mesh-processing code for mugs from ShapeNet.
  2. Provide the collected demonstrations for both pushing and grasping examples.

(Note: we do not plan to release instructions to replicate results of the indoor navigation example in the near future. We plan to refine the simulation in a future version of the paper.)

Omission of the paper

  1. We made the assumption that the latent variables in the CVAE are independent of the states (p(z|s_{1:T}) = p(z)).

pac-imitation's People

Contributors

allenzren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pac-imitation's Issues

This repository cannot be launched even push task.

When I try to launch the push experiment by python trainPush_bc.py push_pac_easy, the following errors are detected:

PAC-Imitation/trainPush_bc.py", line 523, in <module>
    config_dic, data_dic, nn_dic, loss_dic, optim_dic = [value for key, value in json_data.items()]
ValueError: not enough values to unpack (expected 5, got 4)

This issue may be caused by missing loss config information in the following JSON files:
PAC-Imitation/push_pac_easy.json
Could you update this the same as your manuscript?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.