A Neural Chess AI in Python
This aims to be a simple and inefficient chess engine programed in Python for learning about AI, PyTorch and dataset generation
Run app.py with Python3, it works using flask on localhost, go to http://127.0.0.1:5000/ for the move interface
- Simply drag the piece to the desired square, ilegal moves are rejected, promoting to queen is automatic, followed autmatically by an enemy computer move or:
- Human move: Makes the SAN notated move followed autmatically by an enemy computer move
- Computer move: Makes a move using the engine for the side currently playing
Python 3 of course
- chess: A lifesaver, probably wouldn't have started the projet w/o this
- numpy: Efficient data structures
- flask: Interface
optional:
- PyTorch: Neural evaluation (use pip, the conda version is too old)
- cProfile and snakeviz: for profiling to optimize a little more
- Make a chess engine that can beat me 😎
- Use a CNN for eval
- Learn more about PyTorch and dataset generation
- User input via clicking
- Info in the webpage
- NegaMax
- NegaMax + Zobrist Hash with alpha beta pruning
- Iterative deepening
- Aspiration Window
- Negascout (Principal variation search)
-
Pypy(Pypy 3.7 seems 1% to 10% slower than Python 3.8) - Piece value heuristic
- MiniMax
- Board rendering
- Movility to the heuristic
- MiniMax + Alpha Beta pruning
- Piece square tables
- Move ordering (moves that capture pieces may be examined before moves that do not, and moves that have scored highly in earlier passes through the game-tree analysis may be evaluated before others)
- Quiescence search
- User input via submit field
- Automatic enemy move
- Zobrist Hashing
- Tranposition tables
- Neural network evaluation