Code Monkey home page Code Monkey logo

gail_gym's Introduction

Generative Adversarial Imitation Learning for gym environments

gail-ppo-tf-gym

This repository provides a TensorFlow implementation of Generatve Adversarial Imitation Learning (GAIL) and Behavioural Cloning (BC) for classic cartpole-v0 environment from OpenAI Gym. (based on Generative Adversarial Imitation Learning, Jonathan Ho & Stefano Ermon.)

Dependencies

Gym environment

  • CartPole-v0
  • State: Continuous
  • Action: Discrete

Implementation of GAIL:

Step: 1 Generate expert trajectory data

Reinforcement Learning algorithm: PPO, is used for generating the expert trajectory data for the CartPole-v0 environment.

python3 run_ppo.py

Step: 2 Sample the expert trajectory data from the PPO generated trajectories.

python3 sample_trajectory.py

Step: 3.1 Execute Imitation Learning - GAIL.

python3 run_gail.py  

Step: 3.2 To run behavioral cloning

python3 run_behavior_clone.py

Step: 4 Test trained policy for GAIL

python3 test_policy.py

Tensorboard Plots:

Training and Testing results for GAIL

Note: If you want to test bc policy, specify the number of model.ckpt-number in the directory trained_models/bc

For example to test behavioral cloning:

python3 test_policy.py --alg=bc --model=1000

gail-ppo-pytorch-gym

This repository provides a Pytorch implementation of Generatve Adversarial Imitation Learning (GAIL) for bipedwalker-v2 environment from OpenAI Gym.

Gym environment

  • Bipedwalker-v2

  • State space (Continuous): (1) hull angle, (2) angular velocity, (3) horizontal speed, (4) vertical speed, (5) position of joints (6) joints angular speed, (7) legs contact with ground, and (8) lidar rangefinder measurements

  • Action: joint motor torques

PPO generated expert trajectories:

Imitation learning based on GAIL

Sources:

gail_gym's People

Contributors

navuboy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gail_gym's Issues

Two packages are missing

Hello, excuse me, please ask me I encountered this problem in the process of running the code, maybe the author did not upload these two packages, can you share it?
error:
ModuleNotFoundError: No module named 'models.mlp_policy_disc'
Unresolved reference 'DiscretePolicy'

How to run pytorch code

Hi, thanks for sharing your code,

I can only see the tf example code on README, how to launch the pytorch example code?

Thanks,

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.