Giter Club home page Giter Club logo

ammi-rl's Introduction

AMMI-RL

RL Implementation for Continuous Control

This project was initiated in the RL course of Fall 2021 at The African Master's in Machine Intelligence (AMMI) as a course-project where we implemented the SAC algorithm (Haarnoja et al.) for continuous control tasks. It is now an open project where we care to design code bases and benchmarks for RL algorithms in order to ease the development of new algorithms. We are designing this repo based on existing repositories as well as original papers to produce better general implementations for a selected set of algorithms.

Algorithms

Algorithms we are re-implementing/plannning to re-implement:

Algorithms Model Value On Policy MPC Progress Reference
VPG False V(GAE) True False 🟒 Sutton et al., 1999
NPG False V(GAE) True False πŸ”΄ Kakade, 2001
PPO False V(GAE) True False 🟒 Schulman et al., 2017
SAC False 2xQ False False 🟒 Haarnoja et al., 2018
PETS True None None True πŸ”΄ Chua et al., 2018
MB-PPO True V(GAE) True False 🟒 Similar~Rajeswaran et al., 2020
MB-SAC True 2xQ False False 🟒 Janner et al., 2019
MOVOQ True N/A N/A N/A 🟑 N/A
MoPAC True 2xQ False True 🟣 Morgan et al., 2021
MPC-SAC True V(GAE)/2xQ False True πŸ”΄ Omer et al., 2021

🟒 Done || 🟑 Now || 🟣 Next || πŸ”΄ No plan

Generalized Network Hyperparameters

We aim to finetune our implementations to work with a generalized set of hyperparametrs across different algorithms. We are working with the following hyperparameters in the mean time:

β˜‘οΈ Network Arch Act LRate MFOV MFOQ MBOV MBOQ Notes
Policy [2x128] Tanh 3e-4 🟩 🟨 🟩 πŸŸ₯
Policy [2x256] ReLU 3e-4 πŸŸ₯ 🟩 ⬜️ 🟩
βœ… Policy [2x256] PReLU 3e-4 🟩 🟩 🟩 🟦
V [2x128] Tanh 1e-3 🟩 ⬜️ 🟩 ⬜️
V [2x128] PReLU 1e-3 🟩 ⬜️ 🟨 ⬜️
βœ… V [2x256] PReLU 3e-4 🟩 ⬜️ 🟩 ⬜️
Q [2x256] ReLU 3e-4 ⬜️ 🟩 ⬜️ 🟩
βœ… Q [2x256] PReLU 3e-4 ⬜️ 🟩 ⬜️ 🟦
βœ… V-Model [2x512] ReLU 1e-3 ⬜️ ⬜️ 🟩 πŸŸ₯
βœ… Q-Model [4x200] Swish 3e-4 ⬜️ ⬜️ πŸŸ₯ 🟩

🟩 Best || 🟨 Good || πŸŸ₯ Bad || 🟦 In progress

Experiments and Results

In thoe following we evaluate our code on the following environments. Download gifs from this Google drive folder at drive. Results are averaged across 3 random seeds, and smoothed with 0.75 Exponential Moving Average.

Locomotion Tasks

Hopper-v2 Walker2d-v2
HalfCheetah-v2 Ant-v2

Manipulation Tasks

DClaw Valve Turning ShadowHand Cube Re-orientation

How to use this code

Installation

Ubuntu 20.04

Move into AMMI-RL/ directory, and then run the following:

conda create -n ammi-rl python=3.8

pip install -e .

pip install numpy torch wandb gym

If you want to run MuJoCo Locomotion tasks, and ShadowHand, you should install MuJoCo first (it's open sourced until 31th Oct), and then install mujoco-py:

sudo apt-get install ffmpeg

pip install -U 'mujoco-py<2.1,>=2.0'

If you are using A local GPU of Nvidia and want to record MuJoCo environments issue link, run:

unset LD_PRELOAD

MacOS

Move into AMMI-RL/ directory, and then run the following:

conda create -n ammi-rl python=3.8

pip install -e .

pip install numpy torch wandb gym

If you want to run MuJoCo Locomotion tasks, and ShadowHand, you should install MuJoCo first (it's open sourced until 31th Oct), and then install mujoco-py:

brew install ffmpeg gcc

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.mujoco/mujoco200/bin

pip install -U 'mujoco-py<2.1,>=2.0'

If you are using A local GPU of Nvidia and want to record MuJoCo environments issue link, run:

unset LD_PRELOAD

Run an experiment

Move into AMMI-RL/ directory, and then:

python experiment.py -cfg <cfg_file-.py> -seed <int>

for example:

python experiment.py -cfg sac_hopper -seed 1

Evaluate an Agent

To evaluate a saved policy model, run the following command:

python evaluate_agent.py -env <env_name> -alg <alg_name> -seed <int> -EE <int>

for example:

python evaluate_agent.py -env Walker2d-v2 -alg SAC -seed 1 -EE 5

AMMI-RL Team

(last name alphabetical order) | contribution

AMMI-RL Advisors

  • Bilal Piot, Corentin Tallec and Florian Strub (During RL Course Fall 2021)
  • Vlad Mnih, Eszter VΓ©rtes and Theophane Weber (During Rami's AMMI project)

Acknowledgement

This repo was inspired by many great repos, mostly the following ones (not necessarily in order):

ammi-rl's People

Watchers

James Cloos avatar M.Elfatih M.Khair avatar Rami 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.