The pbrain-Z2I
is just a gomoku engine which use the protocol of gomocup. A GUI named qpiskvork can load this engine.
Welcome other game implementions if you want to become the contributor!
- free-style
- standard
- renju
- caro
Linux/Windows (tested on Ubuntu 20 + GPU/CPU and Windows 10 + GPU/CPU)
Both GPU and CPU (GPU test on Tesla V100 + Cuda 11 and CPU test on Intel i5/i7)
C++ (for speed!) and python. The model is trained by pytorch (Python) and onnxruntime (C++, for selfplay), and inferenced by onnxruntime (C++).
gcc (Linux) or visual studio 19 (windows)
cmake 3.13+
pytorch (tested on 1.11)
onnxruntime-gpu (tested on 1.11)
Download and install miniconda / python
and pip install
all the dependent packages such as pytorch
train.sh: convert /data/miniconda3/bin/python
to python
or python3
or your own python intepreter path
Download onnxruntime: https://github.com/microsoft/onnxruntime/releases/tag/v1.11.1
CMakefiles.txt: convert the onnxruntime path to your own path
git clone --recursive https://github.com/Joker2770/Z2I.git
# git submodule update --init --recursive
cd Z2I
mkdir build
cp ./scripts/*.sh ./build/
cd ./build
cmake .. # (or 'cmake -A x64 ..')
cmake --build . --config Release # (or open .sln file through visual Studio 19 and generate for win10)
or build with xmake toolchain(In this way, onnruntime-1.11.1
will be installed with xrepo).
git clone --recursive https://github.com/Joker2770/Z2I.git
# git submodule update --init --recursive
cd Z2I
mkdir build
cp ./scripts/*.sh ./build/
xmake config --mode=release
xmake
cd ./build/
bash train.sh
...
If you want to train the model on windows 10, convert train.sh
to train.bat
and change corresponding commands.
- Run
pbrain-Z2I
, for example on Linux:
./pbrain-Z2I
There is a better way to run pbrain-Z2I
with the GUI program named qpiskvork besides.
Increase or decrease num_mct_sims
in config.toml
(default 100) to increase the power or speed of AI.
- Run mcts_test, for example on Linux:
./mcts_test ./weights/1000.onnx 1
Here 1(or 0) = AI play with black(or white) pieces.
Increase or decrease NUM_MCT_SIMS
in src/common.h (default 1600) to increase the power or speed of AI.