Skip to main content

CusRL: Customizable Reinforcement Learning

Python PyPi License pre-commit DeepWiki

CusRL is a flexible and modular reinforcement-learning framework designed for customization. By breaking down complex algorithms into minimal components, it allows users to easily modify or integrate components instead of rebuilding the entire algorithm from scratch, making it particularly well-suited for advancing 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

List all available experiments:

python -m cusrl list-experiments

Train a PPO agent and evaluate it:

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

Or if you have IssacLab installed:

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

Try distributed training:

torchrun --nproc-per-node=2 -m cusrl train -env Isaac-Velocity-Rough-Anymal-C-v0 \
    -alg ppo --logger tensorboard --env-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 free combination and customization
  • Diverse Network Architectures: Support for MLP, CNN, RNNs, Transformer and custom architectures
  • Modern Training Techniques: Built-in support for distributed and mixed-precision training

Implemented Algorithms

Cite

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

Acknowledgement

CusRL is based on or inspired by these projects:

  • Stable Baselines3: Reliable implementations of reinforcement learning algorithms
  • RSL RL: Fast and simple implementation of RL algorithms
  • IsaacLab: GPU-accelerated simulation environments for robot research
  • robot_lab: RL extension library for robots, based on IsaacLab
  • OnnxSlim: Library for performing optimizations on ONNX models

Metadata

Release files for cusrl 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cusrl 1.2.1
File Size Uploaded
cusrl-1.2.1.tar.gz 206.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cusrl 1.2.1
File Interpreter ABI Platform
cusrl-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 407.9 kB

Release files / cusrl-1.2.1.tar.gz

Download URL cusrl-1.2.1.tar.gz
Size 206.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6ba7d9d349d09794d73e59899cb8379a6a26146b8316d38ddf600ec7c94b4ec4
BLAKE2b-256 checksum
How to use checksums
30fb58915684a1023b7013c57046c006b3ac29ab0b24922b28ee35db3315cbc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / cusrl-1.2.1-py3-none-any.whl

Download URL cusrl-1.2.1-py3-none-any.whl
Size 201.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e45bfedac14555ed8416b1aa1ad1429997410903564027c429ffb121df048ab9
BLAKE2b-256 checksum
How to use checksums
cf03a1c0a2ea30c29d0b6bee804249d8bbfb9342c1aa7cfb83bea281110bc534
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

1.2.2

2 release files

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.9

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page