An implementation of a neural network chess opponent.
pip3 install python-chess torch torchvision numpy flask
# then...
./play.py # runs webserver on localhost:5000
- Look into minimax and rating.
- Decide on a good number of epochs.
Advanced:
- Add RL self play learning support.
- Roll out search beyond 1-ply.
The trained net is in nets/value.pth. It takes in a serialized board and outputs a range from -1 to 1. -1 means black is win, 1 means white is win.
We serialize the board into a 8x8x5 bitvector. See state.py for how.
The value function was trained on 100K board positions for now. More trained functions expected in the near future. Data is from http://www.kingbase-chess.net/