GAiA is a UCI chess engine built with C++ 17, ONNX and PyTorch.
It performs an in-depth analysis and uses a complex squeeze-and-excitation residual network to evaluate each chess board.
GAiA uses Stockfish as a baseline.
It can perform an analysis in reasonable time between depth 10 and 14+ depending on the number of possible moves.
GAiA is not a complete chess program and requires a UCI-compatible graphical user interface (GUI) (e.g. XBoard with PolyGlot, Scid, Cute Chess, eboard, Arena, Sigma Chess, Shredder, Chess Partner or Fritz) in order to be used comfortably.
I wrote an report about GAiA which describes in detail its creation process. You can read it here: Performing Regression on Complex Data using a Squeeze-and-Excitation Residual Neural Network, Chess as a Model System
In order to build GAiA, you need CMake.
GAiA depends on ONNX which is an awesome library
for inferring and even training neural networks. ONNX support many framework
such as CUDA or TensorRT. You need to put the ONNX libraries file in Engine/lib
.
You can find these files here.
Then,
cd Engine/build
cmake ..
make
./GAiA
By default, GAiA is built using the CPU as the execution provider of ONNX because
it was the most efficient on my machine. But you can easily change the EP to CUDA or TensorRT
by changing the variable EP
in the CMakeLists
. The accepted values are CPU
, CUDA
and TENSORRT
position startpos [moves move_list]
position fen your_fen [moves move_list]
go depth n
go infinite
: search until you enterstop
go movetime t
: search for t millisecondsgo wtime t1 btime t2 [winc t3 binc t4]
: Whites hast1
ms on clock Blacks hast2
ms on clock. Whites increment their time byt3
ms and Blacks increment their time byt4
msgo nodes n
search for n nodes (In fact, the number of nodes explored will be a bit greater than n)
All the notebooks and python files used to build GAiA's network are available in
the SE-ResNet
directory.
Notebooks order:
encode.ipynb
choose_hyperparameters.ipynb
train_model.ipynb
results.ipynb