XuanCe: A Comprehensive and Unified Deep Reinforcement Learning Library
XuanCe is an open-source ensemble of Deep Reinforcement Learning (DRL) algorithm implementations.
We call it as Xuan-Ce (玄策) in Chinese. "Xuan (玄)" means incredible and magic box, "Ce (策)" means policy.
DRL algorithms are sensitive to hyper-parameters tuning, varying in performance with different tricks, and suffering from unstable training processes, therefore, sometimes DRL algorithms seems elusive and "Xuan". This project gives a thorough, high-quality and easy-to-understand implementation of DRL algorithms, and hope this implementation can give a hint on the magics of reinforcement learning.
We expect it to be compatible with multiple deep learning toolboxes( PyTorch, TensorFlow, and MindSpore), and hope it can really become a zoo full of DRL algorithms.
Paper link: https://arxiv.org/pdf/2312.16248.pdf
:book: Full Documentation | 中文文档 :book:
CartPole |
Pendulum |
Acrobot |
... |
CartPole |
Pendulum |
Acrobot |
Ant |
HalfCheetah |
Hopper |
Humanoid |
... |
Breakout |
Boxing |
Alien |
Adventure |
Air Raid |
... |
Crossing |
Memory |
Locked Room |
Playground |
... |
XuanCe's documentation for the installation and usage of gym-pybullet-drones.
Helix |
Single-Agent Hover |
Multi-Agent Hover |
... |
Simple Push |
Simple Reference |
Simple Spread |
... |
Battle |
Tiger Deer |
Battle Field |
... |
:computer: The library can be run at Linux, Windows, MacOS, and EulerOS, etc.
Before installing XuanCe, you should install Anaconda to prepare a python environment. (Note: select a proper version of Anaconda from here.)
After that, open a terminal and install XuanCe by the following steps.
Step 1: Create a new conda environment (python>=3.7 is suggested):
conda create -n xuance_env python=3.7
Step 2: Activate conda environment:
conda activate xuance_env
Step 3: Install the library:
pip install xuance
This command does not include the dependencies of deep learning toolboxes. To install the XuanCe with
deep learning tools, you can type pip install xuance[torch]
for PyTorch,
pip install xuance[tensorflow]
for TensorFlow2,
pip install xuance[mindspore]
for MindSpore,
and pip install xuance[all]
for all dependencies.
Note: Some extra packages should be installed manually for further usage.
import xuance
runner = xuance.get_runner(method='dqn',
env='classic_control',
env_id='CartPole-v1',
is_test=False)
runner.run()
import xuance
runner_test = xuance.get_runner(method='dqn',
env='classic_control',
env_id='CartPole-v1',
is_test=True)
runner_test.run()
You can use tensorboard to visualize what happened in the training process. After training, the log file will be automatically generated in the directory ".results/" and you should be able to see some training data after running the command.
$ tensorboard --logdir ./logs/dqn/torch/CartPole-v0
XuanCe also supports Weights & Biases (wandb) tools for users to visualize the results of the running implementation.
How to use wandb online? :arrow_right: https://github.com/wandb/wandb.git/
How to use wandb offline? :arrow_right: https://github.com/wandb/server.git/
You can put your questions, advices, or the bugs you have found in the Issues.
Welcome to join the official communication group with QQ app (Group number: 552432695), and the official account ("玄策 RLlib") on WeChat.
QQ group |
Official account |
@article{liu2023xuance,
title={XuanCe: A Comprehensive and Unified Deep Reinforcement Learning Library},
author={Liu, Wenzhang and Cai, Wenzhe and Jiang, Kun and Cheng, Guangran and Wang, Yuanda and Wang, Jiawei and Cao, Jingyu and Xu, Lele and Mu, Chaoxu and Sun, Changyin},
journal={arXiv preprint arXiv:2312.16248},
year={2023}
}