Coder Social home page Coder Social logo

megatran / pytorch-a2c-ppo-acktr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zackory/pytorch-a2c-ppo-acktr

0.0 0.0 0.0 445 KB

PyTorch implementation of Advantage Actor Critic (A2C), Proximal Policy Optimization (PPO), Scalable trust-region method for deep reinforcement learning using Kronecker-factored approximation (ACKTR) and Generative Adversarial Imitation Learning (GAIL).

License: MIT License

Python 100.00%

pytorch-a2c-ppo-acktr's Introduction

pytorch-a2c-ppo-acktr

A PyTorch implementation of PPO for use with the pretrained models provided in Assistive Gym.
This library includes scripts for training and evluating multi agent policies using co-optimization; specifically, train_coop.py and enjoy_coop.py.

Installation and pretrained models

This library and the pretrained policies for Assistive Gym can be downloaded using the following commands.
If you do not have wget installed on your machine, you can download the models directly from the Assistive Gym GitHub release page.

# Install PyTorch RL library
pip3 install git+https://github.com/Zackory/pytorch-a2c-ppo-acktr --no-cache-dir
# Install OpenAI Baselines
pip3 install git+https://github.com/openai/baselines.git
# Download pretrained policies
cd assistive-gym
wget -O trained_models/ppo/pretrained_policies.zip https://github.com/Healthcare-Robotics/assistive-gym/releases/download/0.100/pretrained_policies.zip
unzip trained_models/ppo/pretrained_policies.zip -d trained_models/ppo

If you receive an error during installation due to MPI (mpi4py), you may need to install the missing MPI package. On Linux, this can be resolved with:

sudo apt install libopenmpi-dev

or on Mac with:

brew install mpich

Examples

Refer to Assistive Gym for more detailed use cases of this reinforcement learning library.

Training - Static human

python3 -m ppo.train --env-name "ScratchItchJaco-v1" --num-env-steps 10000000

We suggest using nohup to train policies in the background, disconnected from the terminal instance.

nohup python3 -m ppo.train --env-name "ScratchItchJaco-v1" --num-env-steps 10000000 --save-dir ./trained_models/ > nohup.out &

See arguments.py for a full list of available arguments and hyperparameters.

Training - Co-optimization, active human and robot

python3 -m ppo.train_coop --env-name "FeedingSawyerHuman-v1" --num-env-steps 10000000

Resume training from an existing policy

python3 -m ppo.train --env-name "FeedingSawyer-v1" --num-env-steps 2000000 --save-dir ./trained_models_new/ --load-policy ./trained_models/ppo/FeedingSawyer-v1.pt

Visual Evaluation - Static human

python3 -m ppo.enjoy --env-name "ScratchItchJaco-v1"

Visual Evaluation - Co-optimization, active human and robot

python3 -m ppo.enjoy_coop --env-name "FeedingSawyerHuman-v1"

Quantitative Evaluation over 100 trails - Static human

python3 -m ppo.enjoy_100trials --env-name "ScratchItchJaco-v1"

Quantitative Evaluation over 100 trails - Active human from co-optimization

python3 -m ppo.enjoy_coop_100trials --env-name "FeedingSawyerHuman-v1"

pytorch-a2c-ppo-acktr-gail

This library is derived from code by Ilya Kostrikov: https://github.com/ikostrikov/pytorch-a2c-ppo-acktr-gail

Please use this bibtex if you want to cite this repository in your publications:

@misc{pytorchrl,
  author = {Kostrikov, Ilya},
  title = {PyTorch Implementations of Reinforcement Learning Algorithms},
  year = {2018},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/ikostrikov/pytorch-a2c-ppo-acktr-gail}},
}

Requirements

pytorch-a2c-ppo-acktr's People

Contributors

ikostrikov2 avatar zackory avatar timmeinhardt avatar erikwijmans avatar maximecb avatar megatran avatar willwhitney avatar nadavbh12 avatar yobibyte avatar ranahanocka avatar bearpaw avatar rwightman avatar linusericsson avatar mabirck avatar alok avatar dineshj1 avatar florianklemt avatar prolearner 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.