Giter Site home page Giter Site logo

bco-1's Introduction

Behavior Cloning (BC) and Behavior Cloning from Observation (BCO)

  • Implementation for Behavior Cloning (BC) and behavior cloning from observation (BCO) (paper) in Pytorch for OpenAI Gym Environment

  • Behavior Cloning (BC) and behavior cloning from observation (BCO) are Imitation Learning algorithms

  • Behavior Cloning (BC) assume that you have access to expert's states and actions but behavior cloning from observation assume that you have access to expert's States only

How it works?

1- Collecting data:

  • Learner: exploration policy, save states and actions

  • Expert: train expert (if you don’t have one), save states only.

  • all data available here

2- Train Inverse dynamic model (T):

  • Input: Learner current state and Learner next state.

  • Output: predicted Learner current action.

  • Loss function: MSE, L1loss or NLL (predicted Learner current action, Learner current action).

3- Test: Inverse dynamic model (T):

  • Input: Expert current state and Expert next state

  • Output: predicted Expert current action.

4- Train Behaviour model (policy ):

  • Input: Expert current state.

  • Output: prediction of predicted Expert current action.

  • Loss: MSE, L1loss or NLL (prediction of predicted Expert current action, predicted Expert current action).

5- Learner interacts with environment BCO(alpha):

  • Learner use Behaviour model (policy ) to get action given current state.

  • Collect new data (states and actions)

  • Use collected data to update Inverse dynamic model (T) and Behaviour model (policy) (repeat 2, 3, and 4)

OpenAI Gym Enviroment

  • Open AI Gym has several environments, We Use classical control environments Pendulum and Bipedal Walker2D environmens.

Installing

pip install gym
pip install numpy
pip install box2d-py
pip install torchvision

Data

Results

BCO VS BC Pendelum_result

alpha

Demo

BC

BCO

bco-1's People

Contributors

montaserfath 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.