← 开源
NeymarL

ChineseChess-AlphaZero

Implement AlphaZero/AlphaGo Zero methods on Chinese chess.

ApplicationsOtherPython
在 GitHub 打开
增长势头
+124 小时新增 Star+0.1%
1.25k
Star
361
Fork
+2
本周
1
贡献者
创建于 2018-01-30 · 更新于 2026-10-16 · 今日第 5694 名
主要开发者

NeymarL/ChineseChess-AlphaZero 排名第 5,694,有 1,250 个星标。

同类别比较

NeymarL/ChineseChess-AlphaZero 排名第 5,694,此处有 8 个同类条目;RhythmicWave/NovelForge 排名第 5,695。

同类别比较
名称排名指标
Taewan-P/gpt_mobile5,685
语言:
Kotlin
星标数:
1,258
分叉数:
146
简介:
Chat app for Android that supports answers from multiple LLMs at once. Bring your own API key AI client. Supports OpenAI, Anthropic, Google, and Ollama. Designed with Material3 & Compose.
antfu/qrcode-toolkit5,686
语言:
Vue
星标数:
1,258
分叉数:
136
简介:
Anthony's QR Code Toolkit for AI generated QR Codes
wfjsw/danbooru-diffusion-prompt-builder5,688
语言:
TypeScript
星标数:
1,257
分叉数:
122
简介:
Danbooru / NovelAI 标签超市
JayWebtech/autoshorts5,689
语言:
Rust
星标数:
1,256
分叉数:
237
简介:
AutoShorts is a local-first desktop application for turning long-form video or audio recordings into high-impact, vertical short-form clip candidates (9:16 portrait) with AI-powered viral moment ranking.
RhythmicWave/NovelForge5,695
语言:
Python
星标数:
1,248
分叉数:
226
简介:
AI辅助长篇小说创作,卡片式创作,支持基于 JSON Schema的结构化 AI 生成与上下文引用,可扩展性强。
bowang-lab/MedRAX5,699
语言:
Python
星标数:
1,246
分叉数:
207
简介:
MedRAX: Medical Reasoning Agent for Chest X-ray - ICML 2025
goodroot/hyprwhspr5,705
语言:
Python
星标数:
1,242
分叉数:
104
简介:
Native speech-to-text for Linux - Fast, accurate, private, and hackable system-wide dictation
thClaws/thClaws5,708
语言:
Rust
星标数:
1,238
分叉数:
183
关键参数与规格
关键参数与规格
参数值
语言Python
类别Applications
子类别Other
关键词Gaming, RL
星标数1,250
分叉数361
贡献者1
创建日期2018-01-30
更新日期2026-10-16
1 天星标数1
7 天星标数2
排名5,694
上次排名5,849
排名变化155
7 天星标排名8,139
上次 7 天星标排名10,064
7 天星标排名变化1,925
总星标排名9,375
上次总星标排名9,369
总星标排名变化-6
国家China
README 摘录

ChineseChess-AlphaZero About Chinese Chess reinforcement learning by AlphaZero methods. This project is based on these main resources: 1. DeepMind's Oct 19th publication: Mastering the Game of Go without Human Knowledge. The **great** Reversi/Chess/Chinese chess development of the DeepMind ideas that @mokemokechicken/@Akababa/@TDteach did in their repo: 3. A Chinese chess engine with gui: **Note**: The distributed version is in distributed branch. **Note**: This repo is still under contruction. There is also a slower implementation of MCTS

player (previous version), see branch old. Contributing In order to build a strong chinese chess AI following the same type of techniques as AlphaZero, we need to do this with a distributed project, as it requires a huge amount of computations. If you want to join us to build the best chinese chess AI in the world: For instructions, see wiki For live status, see Environment Python 3. 8 Modules Reinforcement Learning This AlphaZero implementation consists of two workers: and

. is Self-Play to generate training data by self-play using BestModel. is Trainer to train model, and generate new models. For the sake of faster training (since I don't have 5000 TPUs), another two workers are involved: is Supervised learning to train data crawled from the Internet. is Evaluator to evaluate the NextGenerationModel with the current BestModel. GUI Requirement: pygame **Screenshots** You can choose different board/piece styles and sides, see play with human. How to use Setup install

libraries If you want to use CPU only, replace with in . Make sure Keras is using Tensorflow and you have Python 3. Configuration **PlayDataConfig** : The max game number of training data is . **PlayConfig, PlayWithHumanConfig** : MCTS number per move. : balance parameter of value network and policy network in MCTS. : balance parameter of speed and accuracy in MCTS. Basic Usage Self-Play When executed, Self-Play will start using BestModel. If the BestModel does not exist, new random model will be created

and become BestModel. options : create new BestModel : use mini config, (see ) : specify which gpu to use : whether to play with ucci engine (rather than self play, see ) : run self play in distributed mode which means it will upload the play data to the remote server and download latest model from it Trainer When executed, Training will start. Trained model will be saved every epoch as new BestModel. options : use mini config, (see ) : specify total step(mini-batch) numbers. The total

step affects learning rate of training. : specify which gpu to use **View training log in Tensorboard** And access . Play with human When executed, the BestModel will be loaded to play against human. options : if set this option, AI will move first, otherwise human move first. : use mini config, (see ) : specify which gpu to use : choose a piece style, default is : choose a board style, default is : if set this flag, play with AI in a cli environment rather than gui

**Note**: Before you start, you need to download/find a font file ( ) and rename it as , then put it into .

常见问题

记录了多少星标和分叉?

NeymarL/ChineseChess-AlphaZero 有 1,250 个星标和 361 个分叉。

仓库排名是多少?

NeymarL/ChineseChess-AlphaZero 排名第 5,694。

记录的语言和类别是什么?

NeymarL/ChineseChess-AlphaZero 有 1,250 个星标,语言为 Python,类别为 Applications。

哪个仓库排名最接近?

NeymarL/ChineseChess-AlphaZero 与 RhythmicWave/NovelForge 比较,后者排名第 5,695,有 1,248 个星标。

README

ChineseChess-AlphaZero

About

Chinese Chess reinforcement learning by AlphaZero methods.

This project is based on these main resources:

  1. DeepMind's Oct 19th publication: Mastering the Game of Go without Human Knowledge.
  2. The great Reversi/Chess/Chinese chess development of the DeepMind ideas that @mokemokechicken/@Akababa/@TDteach did in their repo: https://github.com/mokemokechicken/reversi-alpha-zero, https://github.com/Akababa/Chess-Zero, https://github.com/TDteach/AlphaZero_ChineseChess
  3. A Chinese chess engine with gui: https://github.com/mm12432/MyChess

Note: The distributed version is in distributed branch.

Note: This repo is still under contruction. There is also a slower implementation of MCTS player (previous version), see branch old.

Contributing

In order to build a strong chinese chess AI following the same type of techniques as AlphaZero, we need to do this with a distributed project, as it requires a huge amount of computations.

If you want to join us to build the best chinese chess AI in the world:

Environment

  • Python 3.6.3
  • tensorflow-gpu: 1.3.0
  • Keras: 2.0.8

Modules

Reinforcement Learning

This AlphaZero implementation consists of two workers: self and opt.

  • self is Self-Play to generate training data by self-play using BestModel.
  • opt is Trainer to train model, and generate new models.

For the sake of faster training (since I don't have 5000 TPUs), another two workers are involved:

  • sl is Supervised learning to train data crawled from the Internet.
  • eval is Evaluator to evaluate the NextGenerationModel with the current BestModel.

GUI

Requirement: pygame

python cchess_alphazero/run.py play

Screenshots

You can choose different board/piece styles and sides, see play with human.

How to use

Setup

install libraries

pip install -r requirements.txt

If you want to use CPU only, replace tensorflow-gpu with tensorflow in requirements.txt.

Make sure Keras is using Tensorflow and you have Python 3.6.3+.

Configuration

PlayDataConfig

  • nb_game_in_file,max_file_num: The max game number of training data is nb_game_in_file * max_file_num.

PlayConfig, PlayWithHumanConfig

  • simulation_num_per_move : MCTS number per move.
  • c_puct: balance parameter of value network and policy network in MCTS.
  • search_threads: balance parameter of speed and accuracy in MCTS.
  • dirichlet_alpha: random parameter in self-play.

Basic Usage

Self-Play

python cchess_alphazero/run.py self

When executed, Self-Play will start using BestModel. If the BestModel does not exist, new random model will be created and become BestModel.

options

  • --new: create new BestModel
  • --type mini: use mini config, (see cchess_alphazero/configs/mini.py)
  • --gpu '1': specify which gpu to use
  • --ucci: whether to play with ucci engine (rather than self play, see cchess_alphazero/worker/play_with_ucci_engine.py)
  • --distributed: run self play in distributed mode which means it will upload the play data to the remote server and download latest model from it

Trainer

python cchess_alphazero/run.py opt

When executed, Training will start. The current BestModel will be loaded. Trained model will be saved every epoch as new BestModel.

options

  • --type mini: use mini config, (see cchess_alphazero/configs/mini.py)
  • --total-step TOTAL_STEP: specify total step(mini-batch) numbers. The total step affects learning rate of training.
  • --gpu '1': specify which gpu to use

View training log in Tensorboard

tensorboard --logdir logs/

And access http://:6006/.

Play with human

python cchess_alphazero/run.py play

When executed, the BestModel will be loaded to play against human.

options

  • --ai-move-first: if set this option, AI will move first, otherwise human move first.
  • --type mini: use mini config, (see cchess_alphazero/configs/mini.py)
  • --gpu '1': specify which gpu to use
  • --piece-style WOOD: choose a piece style, default is WOOD
  • --bg-style CANVAS: choose a board style, default is CANVAS
  • --cli: if set this flag, play with AI in a cli environment rather than gui

Note: Before you start, you need to download/find a font file (.ttc) and rename it as PingFang.ttc, then put it into cchess_alphazero/play_games. I have removed the font file from this repo because it's too big, but you can download it from here.

Evaluator

python cchess_alphazero/run.py eval

When executed, evaluate the NextGenerationModel with the current BestModel. If the NextGenerationModel does not exist, worker will wait until it exists and check every 5 minutes.

options

  • --type mini: use mini config, (see cchess_alphazero/configs/mini.py)
  • --gpu '1': specify which gpu to use

Supervised Learning

python cchess_alphazero/run.py sl

When executed, Training will start. The current SLBestModel will be loaded. Tranined model will be saved every epoch as new SLBestModel.

About the data

I have two data sources, one is downloaded from https://wx.jcloud.com/market/packet/10479 ; the other is crawled from http://game.onegreen.net/chess/Index.html (with option --onegreen).

options

  • --type mini: use mini config, (see cchess_alphazero/configs/mini.py)
  • --gpu '1': specify which gpu to use
  • --onegreen: if set the flag, sl_onegreen worker will start to train data crawled from game.onegreen.net
  • --skip SKIP: if set this flag, games whoses index is less than SKIP would not be used to train (only valid when onegreen flag is set)
排名相邻
同类项目