rrls

Robust Reinforcement Learning Suite

https://github.com/sureli/rrls

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Robust Reinforcement Learning Suite

Basic Info
  • Host: GitHub
  • Owner: SuReLI
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 719 KB
Statistics
  • Stars: 20
  • Watchers: 5
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Created about 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

pre-commit Code style: black Ruff

Robust Reinforcement Learning Suite (rrls)

rrls Logo

Goal

The goal of rrls is to standardize robust reinforcement learning benchmarks, ensuring that experiments are reproducible and comparable. rrls is designed to follow the gymnasium API.


📦 Installation

From source:

```bash

We have to install the latest version of gymnasium

git clone https://github.com/Farama-Foundation/Gymnasium.git

cd Gymnasium

pip install .

pip install git+https://github.com/SuReLI/RRLS.git

```

Available when Gymasium 1.0 is released

Via pip:

bash pip install rrls

Prerequisites: - Ensure you have MuJoCo installed on your machine. The environments provided by rrls require the MuJoCo physics engine from Deepmind. For detailed installation instructions, please refer to the MuJoCo website and the MuJoCo Github repository. - We have tested and support Python versions 3.9, 3.10, and 3.11 on both Linux and macOS.

🤖 Environments

The package offers the following environments:

| Environment Name | id | |----------------------|-------------------------------------------| | Ant | robust-ant-v0 | | HalfCheetah | robust-halfcheetah-v0| | Hopper | robust-hopper-v0 | | HumanoidStandup | robust-humanoidstandup-v0 | | InvertedPendulum | robust-invertedpendulum-v0 | | Walker2d | robust-walker2d-v0 |

And lot more ... if you want to get a full list of the environments, you can use the following code:

python import gymnasium as gym for env in gym.envs.registry: if "rrls/robust" in env: print(env)

Example of usage:

```python import gymnasium as gym import rrls

env = gym.make("rrls/robust-ant-v0") params = env.get_params() # Parameters will be None if reset method hasn't been called.

Set all parameters to 1

params = {k: 1 for k in params.keys()}

Modify environment parameters during reset using the options argument

obs, info = env.reset(options=params)

Retrieve environment parameters from the info dictionary

print(info["torso_mass"]) # Outputs: all keys are equals to one 1

terminated, truncated = False, False

while not (terminated or truncated): action = env.actionspace.sample() obs, reward, terminated, truncated, info = env.step(action) print(info["torsomass"])

# To change environment parameters during an episode, use the set_params method.
# env.set_params(params)

```

🌯 Wrappers

The package provides the following wrappers: - Domain randomization: rrls.wrappers.DomainRandomization - Probabilistic action robustness: rrls.wrappers.ProbabilisticActionRobust - Adversarial dynamics: rrls.wrappers.DynamicAdversarial

👝 Uncertainty sets

For each environment, we offer a set of uncertainty sets for use. For instance:

python from rrls.envs.ant import AntParamsBound

This Enum includes three variants: 1D, 2D, and 3D uncertainty sets, as referenced from the M2TD3 paper. For instance, the 2D uncertainty set for the Ant environment is defined as follows:

```python from rrls.envs.ant import AntParamsBound

paramsbound2d = AntParamsBound.TWO_DIM.value

{'torsomass': [0.1, 3.0], 'frontleftlegmass': [0.01, 3.0]}

^^^ ^^^

min max

```

Also you can get the uncertainty set provided by the RARL paper

```python from rrls.envs.ant import AntParamsBound rarlparamsbound = AntParamsBound.RARL.value

{

"torsoforce_x": [-3.0, 3.0],

"torsoforce_y": [-3.0, 3.0],

"frontleftlegforce_x": [-3.0, 3.0],

"frontleftlegforce_y": [-3.0, 3.0],

"frontrightlegforce_x": [-3.0, 3.0],

"frontrightlegforce_y": [-3.0, 3.0],

}

```

🤓 Evaluate

If you want benchmark worst-case performance using our extensive suite. For every uncertainty set, we provide a corresponding set of evaluation environments. These environments are created by equally partitioning (into 10 segments) each dimension of the uncertainty set.

python from rrls.evaluate import EVALUATION_ROBUST_ANT_3D # Set consisting of 10^3 environments

If you wish to construct your own custom set of environments, you can utilize the code below:

```python from rrls.evaluate import generateevaluationset from rrls.envs.ant import AntParamsBound, RobustAnt

evalenvset = generateevaluationset( modifiedenv=RobustAnt, parambounds=AntParamsBound.THREEDIM.value, nbmesh_dim=3, ) ```

📖 Project Maintainers

🙏 Acknowledgments

This project is part of the ENVIA initiative, aiming to develop next-gen reinforcement learning controllers for airship transportation of heavy loads. We are grateful to our supporters:

  • Sureli Team
  • Isae Supaero
  • IRT Saint Exupéry
  • Thales

Owner

  • Name: Supaero Reinforcement Learning Initiative
  • Login: SuReLI
  • Kind: organization
  • Location: Toulouse, France

Citation (CITATION.bib)


      

GitHub Events

Total
  • Watch event: 12
  • Push event: 2
Last Year
  • Watch event: 12
  • Push event: 2