GithubHelp home page GithubHelp logo

manish-pra / non-additive-rl Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 0.0 27.86 MB

The repository contains code for Non-additive reward functions in Reinforcement Learning.

License: MIT License

Python 100.00%

non-additive-rl's Introduction

Submodular Reinforcement Learning (SubRL)

The repository contains all code and experiments for submodular policy optimization (SubPO). Currently algorithm/experiments are focused to optimize Non-additive rewards modelled using monotone submodular function. However, the algorithm is general and can be used with any monotone non-Additive reward functions.

Dependencies

  1. The code is tested on Python 3.8.5 and 3.8.10
  2. On the cluster, you can load gcc/8.2.0 python/3.8.5 ffmpeg/5.0
  3. Install packages from requirements.txt

To Run

  1. Set the following params in main.py; by default, it is set to name "subrl". Rest all the things can be changed in the config file
workspace = "subrl"
env_load_path = workspace + \
    "/environments/" + params["env"]["node_weight"]+ "/env_" + \
    str(args.env)

args.env is environment number, params["env"]["node_weight"] takes a value from ${ "constant", "constant", "linear", "bimodal", "gp", "entropy", "steiner_covering"}$. It loads the appropriate environment.

  1. The following commands run the experiments:
python3 subrl/main.py -i $i -env $env_i -param $param_i (finite state action spaces)
python3 subrl/gym_env/gym_subrl.py -i $i -param $param_i (Mujoco-Ant)
python3 subrl/car_racing/subrl.py -i $i -param $param_i (Car-Racing)
$param_i = Name of the param file (see params folder) to pick an algorithm and the environment type
$env_i = an integer to pick an instance of the environment
$i = an integer to run multiple instances
  1. Following example forllowing scripts runs subrl in different environments
python3 subrl/main.py  -i 1 -env 1 -param "GP/subrl_M"
python3 subrl/main.py  -i 1 -env 1 -param "steiner/subrl_M"
python3 subrl/main.py  -i 1 -env 1 -param "entropy/subrl_M"
python3 subrl/main.py  -i 1 -env 1 -param "gorilla/subrl_M"
python3 subrl/main.py  -i 1 -env 1 -param "two_rooms/subrl_M"
python3 subrl/main.py  -i 1 -env 1 -param "coverage/subrl_M" (set node_weight = constant or bimodal)
python3 subrl/main.py  -i 1 -env 1 -param "bimodal/subrl_M"
python3 subrl/car_racing/subrl.py -i 1 -param "car_subrl" 
python3 subrl/gym_env/gym_subrl.py -i 1 -param "gym_subRL" 
  1. Also you can create more config files that can be passed on similar to subrl_M, eg subrl_NM, subrl_SRL, etc. You can visualize results on directly wandb.

non-additive-rl's People

Contributors

manish-pra avatar

Stargazers

 avatar Maurits avatar Yavar Taheri Yeganeh avatar Joe Eappen avatar  avatar  avatar  avatar  avatar Ke Xue avatar

Watchers

Kostas Georgiou avatar  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.