Skip to main content

Customizable and modular RL algorithms implemented in PyTorch

Project description

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 --environment-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 --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 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

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.1.2.tar.gz (118.3 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.1.2-py3-none-any.whl (134.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cusrl-1.1.2.tar.gz
Algorithm Hash digest
SHA256 012c081574368df2434edfd1079e454567e44e7c51dea189782113a149d2a343
MD5 7d8e371c2124b8c3fe5f45d1123cec68
BLAKE2b-256 087965138c9a1d21452b23ea8e524ab8212653ecc6e7420ffe21b176ee6e7411

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cusrl-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 134.3 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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7cc7d2b10552918b271ab5ba4f6fb50fbc8ac0db91c361be25fa4291e39cd69f
MD5 1a699aebbc8af01d78934a647adea5dc
BLAKE2b-256 1b2e8a4f2bdd0c46d149e604b4a4612bcfb2dfaf73d2bcb5662bca0268c36d4b

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