Skip to main content

Benchmark for contextual RL

Project description

CARL

– The Benchmark Library

PyPI Version Test Doc Status Code style: black

CARL (context adaptive RL) provides highly configurable contextual extensions to several well-known RL environments. It's designed to test your agent's generalization capabilities in all scenarios where intra-task generalization is important.

Feel free to check out our paper and our short blog post!

Benchmarks

Benchmarks include:

  • OpenAI gym classic control suite extended with several physics context features like gravity or friction

  • OpenAI gym Box2D BipedalWalker, LunarLander and CarRacing, each with their own modification possibilities like new vehicles to race

  • All Brax locomotion environments with exposed internal features like joint strength or torso mass

  • Super Mario (TOAD-GAN), a procedurally generated jump'n'run game with control over level similarity

  • dm_control, environments based on the MuJoCo physics engine. The environments are extended with different context features.

Screenshot of each environment included in CARL.

For more information, check out our documentation!

Installation

We recommend you use a virtual environment (e.g. Anaconda) to install CARL and its dependencies. We recommend and test with python 3.9 under Linux.

First, clone our repository and install the basic requirements:

git clone https://github.com/automl/CARL.git --recursive
cd CARL
pip install .

This will only install the basic classic control environments, which should run on most operating systems. For the full set of environments, use the install options:

pip install -e ".[box2d,brax,dm_control,mario,rna]"

These may not be compatible with Windows systems. Box2D environment may need to be installed via conda on MacOS systems:

conda install -c conda-forge gym-box2d

In general, we test on Linux systems, but aim to keep the benchmark compatible with MacOS as much as possible. RNA and Mario at this point, however, will not run on any operation system besides Linux.

To install ToadGAN for the Mario environment:

# System requirements
sudo apt install libfreetype6-dev xvfb

If you want to use RNA, please take a look at the associated ReadME.

CARL's Contextual Extension

CARL contextually extends the environment by making the context visible and configurable. During training we therefore can encounter different contexts and train for generalization. We exemplarily show how Brax' Fetch is extended and embedded by CARL. Different instiations can be achieved by setting the context features to different values.

CARL contextually extends Brax' Fetch.

Cite Us

If you use CARL in your research, please cite our paper on the benchmark:

@inproceedings { BenEim2023a,
  author       = {Carolin Benjamins and
                  Theresa Eimer and
                  Frederik Schubert and
                  Aditya Mohan and
                  Sebastian Döhler and
                  André Biedenkapp and
                  Bodo Rosenhahn and
                  Frank Hutter and
                  Marius Lindauer},
  title        = {Contextualize Me - The Case for Context in Reinforcement Learning},
  journal      = {Transactions on Machine Learning Research},
  year         = {2023},
}

References

OpenAI gym, Brockman et al., 2016. arXiv preprint arXiv:1606.01540

Brax -- A Differentiable Physics Engine for Large Scale Rigid Body Simulation, Freeman et al., NeurIPS 2021 (Dataset & Benchmarking Track)

TOAD-GAN: Coherent Style Level Generation from a Single Example, Awiszus et al., AIIDE 2020

dm_control: Software and Tasks for Continuous Control

License

CARL falls under the Apache License 2.0 (see file 'LICENSE') as is permitted by all work that we use. This includes CARLMario, which is not based on the Nintendo Game, but on TOAD-GAN and TOAD-GUI running under an MIT license. They in turn make use of the Mario AI framework (https://github.com/amidos2006/Mario-AI-Framework). This is not the original game but a replica, explicitly built for research purposes and includes a copyright notice (https://github.com/amidos2006/Mario-AI-Framework#copyrights ).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carl_bench-1.1.1.tar.gz (92.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

carl_bench-1.1.1-py3-none-any.whl (131.8 kB view details)

Uploaded Python 3

File details

Details for the file carl_bench-1.1.1.tar.gz.

File metadata

  • Download URL: carl_bench-1.1.1.tar.gz
  • Upload date:
  • Size: 92.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for carl_bench-1.1.1.tar.gz
Algorithm Hash digest
SHA256 1217e8475cbf60ecd56873fe16e0651da03817038e36832da194665763eeeb71
MD5 e6c0c7a563991d9c6f062691581930e9
BLAKE2b-256 48bf3b4c935990502f71aa7ffd3da431aae05f4943cad481cc3cf42f5464ceac

See more details on using hashes here.

Provenance

The following attestation bundles were made for carl_bench-1.1.1.tar.gz:

Publisher: publish_release.yml on automl/CARL

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file carl_bench-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: carl_bench-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 131.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for carl_bench-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d776f1f61413736a90ef0b90ee3deaa0fb6711b2e94c880b84dc43c9263d8037
MD5 3dbb3d16e07930548220fa3aa96e5186
BLAKE2b-256 6a7c521ffeaaa636c29732ac6e28808331b508b7e7d706b543b3ac5383e04d8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for carl_bench-1.1.1-py3-none-any.whl:

Publisher: publish_release.yml on automl/CARL

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page