Welcome to Tianshou!¶
Tianshou (天授) is a reinforcement learning platform based on pure PyTorch. Unlike existing reinforcement learning libraries, which are mainly based on TensorFlow, have many nested classes, unfriendly API, or slow-speed, Tianshou provides a fast-speed framework and pythonic API for building the deep reinforcement learning agent. The supported interface algorithms include:
DQNPolicy
Double DQN with n-step returnsImitationPolicy
Imitation Learning
Tianshou supports parallel workers for all algorithms as well. All of these algorithms are reformatted as replay-buffer based algorithms.
Installation¶
Tianshou is currently hosted on PyPI. You can simply install Tianshou with the following command (with Python >= 3.6):
pip3 install tianshou
You can also install with the newest version through GitHub:
pip3 install git+https://github.com/thu-ml/tianshou.git@master
If you use Anaconda or Miniconda, you can install Tianshou through the following command lines:
# create a new virtualenv and install pip, change the env name if you like
conda create -n myenv pip
# activate the environment
conda activate myenv
# install tianshou
pip install tianshou
After installation, open your python console and type
import tianshou as ts
print(ts.__version__)
If no error occurs, you have successfully installed Tianshou.
Tianshou is still under development, you can also check out the documents in stable version through tianshou.readthedocs.io/en/stable/.