Coder Social home page Coder Social logo

freor / o-raac Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nuria95/o-raac

0.0 0.0 0.0 47.84 MB

Offline Risk-Averse Actor-Critic (O-RAAC). A model-free RL algorithm for risk-averse RL in a fully offline setting

License: MIT License

Python 100.00%

o-raac's Introduction

O-RAAC

Offline Risk-Averse Actor-Critic (O-RAAC). A model-free RL algorithm for risk-averse RL in a fully offline setting.

Code for work presented in: Risk-Averse Offline Reinforcement Learning

Installation

O-RAAC can be installed by cloning the repository as follows. I recommend creating a separate virtual environment for it.

git clone [email protected]:nuria95/O-RAAC.git
cd O-RAAC
virtualenv venv
pip install -e .

In order to run O-RAAC you need to install D4RL (follow the instructions in https://github.com/rail-berkeley/d4rl) and you need MuJoCo as a dependency. You may need to obtain a license and follow the setup instructions for mujoco_py. This mostly involves copying the key to your MuJoCo installation folder.

Training

To train the ORAAC model you need to: Activate the environment: source venv/bin/activate Run the code: python3 experiments/oraac.py --config_name 'name_json_file'

where 'name_json_file' is a .json file stored in json_params/ORAAC. We provide the json files with the default parameters we used for each environment to get the results in the paper. To optimize for different risk distortions modify the field in the json_file or provide it as an argument accordingly. --RISK_DISTORTION 'risk_distortion' where 'risk_distortion' can be 'cvar' or 'cpw' or 'wang'.

Evaluation:

The best trained models (according to 0.1 CVaR and Mean metrics) for each environment are saved in the model-zoo folder. To evaluate the policies using such models you can do: python3 experiments/oraac.py --model_path 'name of environment' where 'name of environment' can be:

  • halfcheetah-medium
  • halfcheetah-expert
  • walker2d-medium
  • walker2d-expert
  • hopper-medium
  • hopper-expert

We also implemented the BEAR algorithm for the baselines. To run it: python3 experiments/run.py --agent_name BEAR --config_name 'name_json_file'

o-raac's People

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.