Tianshou

Tianshou

โ˜… 4.2 ๐Ÿ”– 4000 saves ๐Ÿ’ฐ Free GitHub

Tianshou is an elegant deep reinforcement learning library built on PyTorch, developed by researchers at Tsinghua University. It packages more than twenty modern RL algorithms into clean, readable, production-quality code, and has earned about 11,000 stars on GitHub with development continuing into 2026.

Overview

The library covers the full RL workflow: vectorized environment wrappers for fast parallel data collection, modular policy implementations, replay buffers, trainers for online, offline and imitation learning, and extensive logging. Algorithms include DQN variants, PPO, SAC, TD3, DDPG, TRPO, NPG, plus offline methods such as CQL and BCQ, all sharing a consistent API that makes swapping algorithms a one-line change. Tianshou is known in the research community for code clarity โ€” the implementations are heavily tested and documented, so papers’ results can be reproduced and then customized. It integrates with MuJoCo, Atari and custom Gymnasium environments out of the box. Beyond the algorithm collection, Tianshou’s collectors and replay buffers are engineered for throughput, gathering experience from many simulators in parallel through vectorized environments. The project maintains extensive documentation and tutorials that build from a first DQN to distributed training, plus a test suite that keeps published benchmark scores reproducible across releases. Development is led by Tsinghua’s machine learning group with a broad contributor base, and it has become a standard reference implementation cited across reinforcement learning courses and papers.

Key Features

  • 20+ algorithms: PPO, SAC, TD3, DQN family, TRPO, CQL and more
  • Online, offline and imitation learning workflows in one library
  • Vectorized environments for high-throughput data collection
  • Modular, readable PyTorch code built for research and teaching
  • Reproducible benchmark results with thorough tests and docs
  • Works with Gymnasium, MuJoCo, Atari and custom environments

๐Ÿ’ณ Pricing

Tianshou is completely free and open source under the MIT license, for both research and commercial projects.

Who Is It For

Tianshou is for RL researchers, students and engineers who want trustworthy PyTorch implementations they can read, reproduce and extend โ€” from coursework to robotics and game AI experiments.

๐Ÿš€ Visit Tianshou Official Site

๐Ÿšฉ Report an issue