Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
xingtian is a componentized library for the development and verification of reinforcement learning algorithms
| Date | Stars |
|---|---|
| 2026-08-02 | 318 |
| 2026-08-11 | 318 |
| 2026-08-12 | 318 |
| 2026-08-18 | 318 |
| 2026-08-20 | 318 |
| 2026-10-23 | 319 |
| 2026-11-04 | 319 |
Today
— stars today
This week
— stars this week
This month
+1 stars this month
Momentum
0.0
growth rate 0.00%/day
<div align="center">
<img width="300px" height="auto" src="./docs/.images/xingtian-logo.png">
</div>
[中文](./README.cn.md)
## Introduction
[](https://opensource.org/licenses/MIT)
**XingTian (刑天)** is a componentized library for the development and verification of reinforcement learning algorithms. It supports multiple algorithms, including DQN, DDPG, PPO, and IMPALA etc, which could training agents in multiple environments, such as Gym, Atari, Torcs, StarCraftII and so on. To meet users' requirements for quick verification and solving RL problems, four modules are abstracted: `Algorithm`, `Model`, `Agent`, and `Environment`. They work in a similar way as the combination of `Lego' building blocks. For details about the architecture, please see the [Architecture introduction](./docs/basic_arch.en.md).
## Dependencies
```shell
# ubuntu 18.04
sudo apt-get install python3-pip libopencv-dev -y
pip3 install opencv-python
# run with tensorflow 1.15.0 or tensorflow 2.3.1
pip3 install zmq h5py gym[atari] tqdm imageio matplotlib==3.0.3 Ipython pyyaml tensorflow==1.15.0 pyarrow lz4 fabric2 absl-py psutil tensorboardX setproctitle
```
or, using `pip3 install -r requirements.txt`
If your want to used PyTorch as the backend, please install it by yourself. [Ref Pytorch](https://pytorch.org/get-started/locally/)
## Installation
```zsh
# cd PATH/TO/XingTian
pip3 install -e .
```
After installation, you could use `import xt; print(xt.__Version__)` to check whether the installation is successful.
```python
In [1]: import xt
In [2]: xt.__version__
Out[2]: '0.3.0'
```
## Quick Start
---------
#### Setup configuration
Follow's configuration shows a minimal example with [Cartpole](https://gym.openai.com/envs/CartPole-v0/) environment.
More detailed description with the parameters of agent, algorithm and environment could been find in the [User guide](./docs/user.en.md) .
```yaml
alg_para:
alg_name: PPO
alg_config:
process_num: 1
save_model: True # default False
save_interval: 100
env_para:
env_name: GymEnv
env_info:
name: CartPole-v0
vision: False
agent_para:
agent_name: PPO
agent_num : 1
agent_config:
max_steps: 200
complete_step: 1000000
complete_episode: 3550
model_para:
actor:
model_name: PpoMlp
state_dim: [4]
action_dim: 2
input_dtype: float32
model_config:
BATCH_SIZE: 200
CRITIC_LOSS_COEF: 1.0
ENTROPY_LOSS: 0.01
LR: 0.0003
LOSS_CLIPPING: 0.2
MAX_GRAD_NORM: 5.0
NUM_SGD_ITER: 8
SUMMARY: False
VF_SHARE_LAYERS: False
activation: tanh
hidden_sizes: [64, 64]
env_num: 10
```
In addition, your could find more configuration sets in [examples](./examples) directory.
#### Start training task
```python3 xt/main.py -f examples/cartpole_ppo.yaml -t train```

#### Evaluate local trained model
Set `benchmark.eval.model_path` for evaluation within the `YOUR_CONFIG_FILE.yaml`
```
benchmark:
eval:
model_path: /YOUR/PATH/TO/EVAL/models
gap: 10 # index gap of eval model
evaluator_num: 1 # the number of evaluator instance
# run command
python3 xt/main.py -f examples/cartpole_ppo.yaml -t evaluate
```
> NOTE: XingTian start with `-t train ` as default.
#### Run with CLI
```zsh
# Could replace `python3 xt/main.py` with `xt_main` command!
xt_main -f examples/cartpole_ppo.yaml -t train
# train with evaluate
xt_main -f examples/cartpole_ppo.yaml -t train_with_evaluate
```
## Develop with Custom case
1. Write custom module, and register it. More detail guidance on custom module can be found in the [Developer Guide](./docs/developer.en.md)
2. Add YOUR-CUSTOM-MODULE name into `your_train_configure.yaml`
3. Start training with `xt_main -f path/to/your_train_configure.yaml` :)
## Reference Results
#### Episode Reward Average
1. **DQN** Reward after 10M time-steExcerpt of 6,911 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:ea457e0155f69140, llm:Repository description and README: 'componentized library for the development and verification of reinforcement learning algorithms'; topics include dqn, impala, muzero, ppo, qmix, reinforcement-learning-algorithms; supports multiple algorithms and environments (Gym, Atari, StarCraftII).
matched fp:ea457e0155f69140, llm:Repository description and README: 'componentized library for the development and verification of reinforcement learning algorithms'; topics include dqn, impala, muzero, ppo, qmix, reinforcement-learning-algorithms; supports multiple algorithms and environments (Gym, Atari, StarCraftII).
matched fp:ea457e0155f69140, llm:Repository description and README: 'componentized library for the development and verification of reinforcement learning algorithms'; topics include dqn, impala, muzero, ppo, qmix, reinforcement-learning-algorithms; supports multiple algorithms and environments (Gym, Atari, StarCraftII).