Coder Social home page Coder Social logo

deepirl's Introduction

Deep IRL

Repo maintained by Abhisek Konar, Bobak H. Baghi.

Installation

To install the necessary python environment, either globally or in a virtual env, run:

pip -r requirements3.txt

NOTE: For the old python2 files, run pip -r requirements.txt in a seperate python2 installation.

Running

The code is structured around running experiment scripts, located in the experiments folder. Make sure you change directory to this folder to ensure proper function.

For example, to train an actor-critic model on a gridworld, run:

python gridworld_ac.py

To run the trained agent and generate expert trajectories, run:

python gridoworld_ac.py --policy-path './saved-models/0.pt' --play

In any of the above, pass the --render flag to display the environment, e.g.:

python gridworld_ac.p --render

python gridoworld_ac.py --policy-path './saved-models/0.pt' --play --render

Note: The flags/options passed to experiment files are unique to each experiment, and users are encouraged to write their own experiments based on their needs. The above is simply a sample.

###Generating expert demonstrations with a new feature extractor.

The code in the repository is modular and feature extractors can be easily be swapped in and out at the start of rl/irl runs. Changing feature extractors while running RL is easy, but swapping feature extractors while training IRL needs the expert demonstrations of that exact feature extractors. Additionally, the parameters of the feature extractor used to create the expert demonstrations should be same as the parameters being used in the training.

Steps to generate expert demonstrations:

  1. Open /envs/drone_data_utils.py
  2. Under the main(), find the section for extracting trajectories. Something like this #********* section to extract trajectories*********
  3. Uncomment the section. Comment the other sections.
  4. Put the name of the desired feature extractor in the variable 'feature_extractor_name'. This will be used to name the folder to store the generated expert demonstrations.
  5. Adjust the feature extractor parameters and initialize the feature extractor.
  6. Run the file.

deepirl's People

Contributors

bobakbaghi avatar ranok92 avatar

Stargazers

 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.