This is an implementation of the AlphaZero algorithm for playing the simple board game Gomoku (also called Gobang or Five in a Row) from pure self-play training. The game Gomoku is much simpler than Go or chess, so that we can focus on the training scheme of AlphaZero and obtain a pretty good AI model on a single PC in a few hours.
- Python 3.9
- Numpy 1.21.1
- Pytorch 1.9.0
To play with provided models, run the following script from the directory:
python src/env/human_play.py
You may modify human_play.py to try different provided models or the pure MCTS.
To train the AI model from scratch, directly run:
python src/train.py
This program is released under Apache License 2.0.