Giter VIP home page Giter VIP logo

a-silfd's Introduction

Accelerating Self-Imitation Learning from Demonstrations

Code for Accelerating Self-Imitation Learning from Demonstrations via Policy Constraints and Q-Ensemble.

1.Installation

To run experiments, you will need to install the following packages preferably in a conda virtual environment

  • gym==0.18.0
  • mujoco_py
  • torch==1.11.0
  • tqdm==4.64.0
  • tensorboardX==2.5.1
  • scipy==1.8.0
  • numpy==1.22.3

Suggested build environment:

```
conda create -n a-silfd python=3.8
conda activate a-silfd
pip install -r requirements.txt
```

2.How to run the code

To run the code with the default parameters, simply execute the following command:

2.1 A-SILfD

2.1.1 Expert Demonstrations

Run A-SILfD on environment Ant-v2, Hopper-v2, Walker2d-v2, HalfCheetah-v2, running seed = 10:

python run.py --task=ant --algo=A-SILfD --seed=10 --save=True --train=True --gpu-no=0 --expert-type=expert
python run.py --task=hopper --algo=A-SILfD --seed=10 --save=True --train=True --gpu-no=0 --expert-type=expert
python run.py --task=walker2d --algo=A-SILfD --seed=10 --save=True --train=True --gpu-no=0 --expert-type=expert
python run.py --task=halfcheetah --algo=A-SILfD --seed=10 --save=True --train=True --gpu-no=0 --expert-type=expert

2.1.2 Mixed Expert Demonstrations

python run.py --task=ant --algo=A-SILfD --seed=10 --save=True --train=True --gpu-no=0 --expert-type=mix
python run.py --task=hopper --algo=A-SILfD --seed=10 --save=True --train=True --gpu-no=0 --expert-type=mix
python run.py --task=walker2d --algo=A-SILfD --seed=10 --save=True --train=True --gpu-no=0 --expert-type=mix
python run.py --task=halfcheetah --algo=A-SILfD --seed=10 --save=True --train=True --gpu-no=0 --expert-type=mix

2.1.3 Sub-optimal Expert Demonstrations

python run.py --task=ant --algo=A-SILfD --seed=10 --save=True --train=True --gpu-no=0 --expert-type=sub
python run.py --task=hopper --algo=A-SILfD --seed=10 --save=True --train=True --gpu-no=0 --expert-type=sub
python run.py --task=walker2d --algo=A-SILfD --seed=10 --save=True --train=True --gpu-no=0 --expert-type=sub
python run.py --task=halfcheetah --algo=A-SILfD --seed=10 --save=True --train=True --gpu-no=0 --expert-type=sub

2.2 REDQ-TD3

2.2.1 REDQ-TD3

python run.py --task=ant --algo=redq_td3 --seed=10 --save=True --train=True --gpu-no=0 
python run.py --task=hopper --algo=redq_td3 --seed=10 --save=True --train=True --gpu-no=0 
python run.py --task=walker2d --algo=redq_td3 --seed=10 --save=True --train=True --gpu-no=0 
python run.py --task=halfcheetah --algo=redq_td3 --seed=10 --save=True --train=True --gpu-no=0 

2.2.2 REDQ-TD3-BC

python run.py --task=ant --algo=redq_td3 --seed=10 --save=True --train=True --gpu-no=0 --expert-type=expert --bc-pre-train=True
python run.py --task=hopper --algo=redq_td3 --seed=10 --save=True --train=True --gpu-no=0 --expert-type=expert --bc-pre-train=True
python run.py --task=walker2d --algo=redq_td3 --seed=10 --save=True --train=True --gpu-no=0 --expert-type=expert --bc-pre-train=True
python run.py --task=halfcheetah --algo=redq_td3 --seed=10 --save=True --train=True --gpu-no=0 --expert-type=expert --bc-pre-train=True

2.2.3 REDQ-TD3-LfD

python run.py --task=ant --algo=redq_td3 --seed=10 --save=True --train=True --gpu-no=0 --expert-type=expert --pretrain_demo=True
python run.py --task=hopper --algo=redq_td3 --seed=10 --save=True --train=True --gpu-no=0 --expert-type=expert --pretrain_demo=True
python run.py --task=walker2d --algo=redq_td3 --seed=10 --save=True --train=True --gpu-no=0 --expert-type=expert --pretrain_demo=True
python run.py --task=halfcheetah --algo=redq_td3 --seed=10 --save=True --train=True --gpu-no=0 --expert-type=expert --pretrain_demo=True

The other Baseline code implementations are as follows:

Algorithm code
AWAC https://github.com/ikostrikov/jaxrl
IQL https://github.com/ikostrikov/implicit_q_learning
SAIL https://github.com/illidanlab/SAIL
OPOLO https://github.com/illidanlab/opolo-code
DAC https://github.com/illidanlab/opolo-code

a-silfd's People

Contributors

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