AlphaGoWeak
is go game bot based on deep learning. Her principle is similar to that of AlphaGo
but can run in personal computer easily. I made her just for fun. She has some interesting specialties as follows:
- Downloading, unpacking and parsing SGF (Smart Game Format) data automatically.
- Fully Win32, Linux, Mac platform support.
- Multiprocessing optimization.
- GPU computing.
- GUI support.
- Support for GTP (Go Text Protocol).
- Support for command line tools.
- Reinforcement learning.
- Support for MCST (Monte Carlo Search Tree).
The model structure is generated by Keras. This kind of network structure is very efficient, and can work half a time.
The input of chessboard grid contains 11 features, which is few but very representative. Quite a lot of scholars like a large number of feature layers, and this will make the training network get twice the result with half the effort. But I think too many feature layers will not only reduce the efficiency of network operation, but also exert too much human influence and make the network rigid. So I used a few feature layers. Although the accuracy of prediction is less than that of multi feature layer, the accuracy of policy network can still reach about 42% just after a few hours of training. Considering that reinforcement learning will be carried out next, the loss of accuracy when using less feature inputs is acceptable because it runs faster.
Feature name | Number of planes | Description |
---|---|---|
Stone color | 2 | Whether there is next player / opposite player's stone. |
Valid position | 1 | Whether there is a valid position. |
Player Liberties | 4 | (1,2,3,>=4) Number of liberties (empty adjacent points) of the player's stones have. |
Opposite Liberties | 4 | (1,2,3,>=4) Number of liberties of the opposite player's stones have. |
-
Assume you are in
<project_folder>
. -
Run command
pip install -r requirements.txt
to install prerequisites, assume you can use TensorFlow with GPU normally. -
Run command
python main.py download --type u-go
to download datasets from the Internet. If the network speed is too slow, you may need to use an accelerator. Mirroring is not supported currently. -
Run command
python main.py train --init 4096
to train your model. The weights file is saved and loaded automatically. -
The default training logging directory is
.data/model/alphago_weak_v0/logs
. You can typetensorboard --logdir <log_folder>
to see training history. -
More commands is not written because they are experimental at now.
Currently the project for AlphaGoWeak
has not been finished, so it can only be executed by modifying the source code.