Coder Social home page Coder Social logo

nagisazj / ac-teach Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stanfordvl/ac-teach

0.0 1.0 0.0 92.29 MB

Code for the CoRL 2019 paper AC-Teach: A Bayesian Actor-Critic Method for Policy Learning with an Ensemble of Suboptimal Teachers

Home Page: https://sites.google.com/view/acteach/

License: MIT License

Jupyter Notebook 17.51% Python 82.19% Shell 0.07% Makefile 0.11% Dockerfile 0.02% Batchfile 0.04% TeX 0.05%

ac-teach's Introduction

AC-Teach

Code for the CoRL 2019 paper AC-Teach: A Bayesian Actor-Critic Method for Policy Learning with an Ensemble of Suboptimal Teachers

Installation

Requires a MuJoCo license and must have mujoco installed. Please see instructions here to install MuJoCo.

Optionally create a new virtual environment and activate it with:

virtualenv -p python3 env
source env/bin/activate

Then, install the repository and dependencies with:

pip install -r requirements.txt
pip install -e .

Training

Here's an example to train a bayesian DDPG policy with the AC-Teach behavioral policy on the pick-place task using both a pick and place teacher with this command:

python scripts/run.py --config cfg/pick_place/experiments/efficiency/partial_complete_suboptimal/train_ours.yaml

You can optionally specify the location of log files with the following arguments, otherwise a logs directory is created under the base repository folder.

--log-base-dir : base directory to use for logs (a log directory will automatically be created using the environment and experiment name)
--experiment-name : name used in creating log files
--log-dir : full path to a desired log directory (overrides the above two arguments)

To view tensorboard logs, navigate to the log directory and run

tensorboard --logdir .

Evaluation

To evaluate and visualize a trained agent, run the following, replacing the --config argument with the appropriate eval config for the environment, and the --load-path argument with the agent checkpoint:

python scripts/run.py --config cfg/pick_place/eval.yaml --load-path /path/to/checkpoint

To avoid rendering to the screen, pass --render-eval 0.

A jupyter notebook, 'Analyze Logs.ipynb', is also included under the scripts directory for processings sets of logs for plots with variance and multiple policies. Note that it assumes it is in the base log directory.

Adding a new environment or new teachers

You can copy the structure of the configs from another environment into cfg/your_environment and make sure the environment is registered with Gym (see here for example).

Then, you should add a file under src/ac-teach/teachers/ (see here for an example).

Finally, ensure your environment has a make_teachers function (see here for an example) that associates the type string argument with a set of teachers. This argument can be specified in cfg/your_environment/teachers/your_teacher_config.yaml (here is an example), and you can link this teacher configuration to your main configuration (example).

Experimenting with AC-Teach algorithm

The AC-Teach algorithm is implemented in the ACTeachStrategy in behavior_policies.py. You can vary parameters to it in the yaml files, or implement your own behavior policies and add them to make_behavior_policy in behavior_policies.py to compare them to AC-Teach.

Citation

If you use this code in your work please cite our paper:

@article{kurenkov2019ac,
  title={AC-Teach: A Bayesian Actor-Critic Method for Policy Learning with an Ensemble of Suboptimal Teachers},
  author={Kurenkov, Andrey and Mandlekar, Ajay and Martin-Martin, Roberto and Savarese, Silvio and Garg, Animesh},
  journal={arXiv preprint arXiv:1909.04121},
  year={2019}
}

ac-teach's People

Contributors

amandlek avatar andreykurenkov avatar nagisazj avatar

Watchers

 avatar

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.