Skip to main content

Customizable and modular RL algorithms implemented in PyTorch

Project description

CusRL: Customizable Reinforcement Learning

CusRL is a flexible and modular reinforcement learning framework that emphasizes customization. Its clean and decoupled implementation allows researchers to easily integrate new components, which is particularly useful for advancements in robotics learning.

Note: This project is under active development, which means the interface is unstable and breaking changes are likely to occur frequently.

Setup

CusRL requires Python 3.10 or later. It can be installed via PyPI with:

# Choose one of the following:
# 1. Minimal installation
pip install cusrl
# 2. Install with export and logging utilities
pip install cusrl[all]

or by cloning this repository and installing it with:

git clone https://github.com/chengruiz/cusrl.git
# Choose one of the following:
# 1. Minimal installation
pip install -e . --config-settings editable_mode=strict
# 2. Install with optional dependencies
pip install -e .[all] --config-settings editable_mode=strict
# 3. Install dependencies for development
pip install -e .[dev] --config-settings editable_mode=strict
pre-commit install

Quick Start

Try to train a PPO agent with CusRL and evaluate it:

python -m cusrl.launch.train -env MountainCar-v0 -alg ppo --logger tensorboard --seed 42
python -m cusrl.launch.play --checkpoint logs/MountainCar-v0:ppo

Or if you have IssacLab installed:

python -m cusrl.launch.train -env Isaac-Velocity-Rough-Anymal-C-v0 -alg ppo \
    --logger tensorboard --environment-args="--headless"
python -m cusrl.launch.play --checkpoint logs/Isaac-Velocity-Rough-Anymal-C-v0:ppo

Try distributed training:

torchrun --nproc-per-node=2 -m cusrl.launch.train -env Isaac-Velocity-Rough-Anymal-C-v0 \
    -alg ppo --logger tensorboard --environment-args="--headless"

Highlights

CusRL provides a modular and extensible framework for RL with the following key features:

  • Modular Design: Components are highly decoupled, allowing for easy customization and extension
  • Diverse Network Architectures: Support for MLP, CNN, RNNs, Transformer and custom architectures
  • Modern Training Techniques: Built-in support for distributed and mixed-precision training

CusRL is designed for researchers and practitioners who need a clean, extensible framework for implementing and experimenting with reinforcement learning algorithms. The architecture emphasizes clean separation of concerns, allowing users to modify specific components without disrupting the rest of the system.

Implemented Algorithms

Cite

If you find this framework useful for your research, please consider citing our work on legged locomotion:

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

cusrl-1.0.1.tar.gz (90.5 kB view details)

Uploaded Source

Built Distribution

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

cusrl-1.0.1-py3-none-any.whl (105.2 kB view details)

Uploaded Python 3

File details

Details for the file cusrl-1.0.1.tar.gz.

File metadata

  • Download URL: cusrl-1.0.1.tar.gz
  • Upload date:
  • Size: 90.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for cusrl-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d0844eee0e55f430a115fa51af20e4a04558da28dd2d24cad1bc8b5f0efd6e34
MD5 82f3ebb0123ab9eb0fb45057e42ecc24
BLAKE2b-256 d874abcf46126585ecf82ad44f838c0b71d00961ca66e09aab29a0a0114747ec

See more details on using hashes here.

File details

Details for the file cusrl-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: cusrl-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 105.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for cusrl-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 70faee2cc571ca48810173a00e9272575600640e51c2821ec63dbcf30f8cf7e9
MD5 9a186f159bb2372bf06b3d92e531bace
BLAKE2b-256 f9b2e69a0d98e444e72f6a535c24a3759e846b884c65105d13c486dd48162a2d

See more details on using hashes here.

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