CusRL: Customizable Reinforcement Learning
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
- Action Smoothness Constraint
- Adversarial Motion Prior (AMP)
- Generalized Advantage Estimation (GAE) with distinct lambda values
- Privileged Training (Policy Distillation)
- Proximal Policy Optimization (PPO) with recurrent policy support
- Random Network Distillation (RND)
- Symmetry Augmentations:
Cite
If you find this framework useful for your research, please consider citing our work on legged locomotion:
- A Spatio-Temporal Hierarchical Framework for Legged Navigation Via Closed-Loop Dynamics Proxy Model, IROS 2026
- Efficient Learning of A Unified Policy For Whole-body Manipulation and Locomotion Skills, IROS 2025 Best Paper Award Finalist
- Learning Symmetric Legged Locomotion via State Distribution Symmetrization, IROS 2025
- Learning Accurate and Robust Velocity Tracking for Quadrupedal Robots, JFR 2025
- Learning Safe Locomotion for Quadrupedal Robots by Derived-Action Optimization, IROS 2024
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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cusrl-1.2.2.tar.gz | 207.2 kB | Without provenance | Details for cusrl-1.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cusrl-1.2.2-py3-none-any.whl | Python 3 | none | any | Details for cusrl-1.2.2-py3-none-any.whl |
Total release size: 408.5 kB
Release files / cusrl-1.2.2.tar.gz
| Download URL | cusrl-1.2.2.tar.gz |
|---|---|
| Size | 207.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4721dce9e46b06c54cf5e9a45d5eb47ce89dfebc2df1b4984e77fa9b0949c26c
|
|
BLAKE2b-256 checksum How to use checksums |
88f15ef2d6b13cd018df3d0af39410d965ceef9a17df202d716fe14795ccca14
|
| 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.2-py3-none-any.whl
| Download URL | cusrl-1.2.2-py3-none-any.whl |
|---|---|
| Size | 201.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0021f924c493ddeee5d23f209a3ce15750c70b42cc17ffb26edd086684b8beae
|
|
BLAKE2b-256 checksum How to use checksums |
103d7fcd45d5ce2f7e4b6a113a118e63e77f58e864d054bf444d516138f13333
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for cusrl 1.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.