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.
Installation
Requires Python >= 3.10.
git clone https://github.com/chengruiz/cusrl.git
# Minimal installation
pip install -e . --config-settings editable_mode=strict
# Install with all optional dependencies
pip install -e .[all] --config-settings editable_mode=strict
# For development, install pre-commit (assuming you have pre-commit installed)
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
- Proximal Policy Optimization (PPO) with recurrent policy support
- Generalized Advantage Estimation (GAE) with distinct lambda values
- Preserving Outputs Precisely, while Adaptively Rescaling Targets (Pop-Art)
- Random Network Distillation (RND)
- Symmetry Augmentations: Symmetry Loss, Symmetric Architecture, Symmetric Data Augmentation
Cite
If you find this framework useful for your research, please consider citing our work on legged locomotion:
- Efficient Learning of A Unified Policy For Whole-body Manipulation and Locomotion Skills, Accepted by IROS 2025
- Learning Accurate and Robust Velocity Tracking for Quadrupedal Robots, Accepted by JFR
- Learning Safe Locomotion for Quadrupedal Robots by Derived-Action Optimization, Published in IROS 2024
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cusrl-1.0.0.tar.gz.
File metadata
- Download URL: cusrl-1.0.0.tar.gz
- Upload date:
- Size: 86.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3b5bed76f05499f5c03e0ab3d0f7304782c791362c34d75aff952924f376ade
|
|
| MD5 |
f433ac7a4d04297fde942595d26619f9
|
|
| BLAKE2b-256 |
e7bd20845cdf3154b5f2a628f0e999bf6b1b0a8a0021ffc2a7292e02d78e8111
|
File details
Details for the file cusrl-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cusrl-1.0.0-py3-none-any.whl
- Upload date:
- Size: 100.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60e8d9387e2716ee4e0bc88eb81affafeaffd78ae57ae63171729c082efaf6c7
|
|
| MD5 |
c910c8ad3514c0e95361da587c654f90
|
|
| BLAKE2b-256 |
fe8b81b2c64ee9707ee03840935fc123b689526873303b7fd74b33fab52d3d13
|