All Projects → ashudeep → ConvChess

ashudeep / ConvChess

Licence: MIT license
Convolutional Neural Networks learns to play chess moves

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to ConvChess

Realtime-OpenCV-Chess
♔ Chess-playing with Open-CV [Human vs AI (Stockfish engine)]
Stars: ✭ 18 (+28.57%)
Mutual labels:  chess-engine, chess
liground
A free, open-source and modern Chess Variant Analysis GUI for the 21st century
Stars: ✭ 41 (+192.86%)
Mutual labels:  chess-engine, chess
magic-bits
A C++ header-only library for efficient move generation in Chess using "magic bitboards" technique
Stars: ✭ 26 (+85.71%)
Mutual labels:  chess-engine, chess
Demolito
UCI Chess Engine
Stars: ✭ 41 (+192.86%)
Mutual labels:  chess-engine, chess
Walleye
A chess engine written from scratch in Rust ♞
Stars: ✭ 82 (+485.71%)
Mutual labels:  chess-engine, chess
OpenChess
A cross-platform chess game.
Stars: ✭ 18 (+28.57%)
Mutual labels:  chess-engine, chess
stockfish-chess-web-gui
Responsive chess web GUI to play against the Stockfish 10 chess engine. Multiple web GUI implementations have also been included.
Stars: ✭ 21 (+50%)
Mutual labels:  chess-engine, chess
littlewing
Chess engine written in Rust ♛
Stars: ✭ 27 (+92.86%)
Mutual labels:  chess-engine, chess
Bit-Genie
UCI chess engine in C++
Stars: ✭ 19 (+35.71%)
Mutual labels:  chess-engine, chess
zahak
A UCI compatible chess AI in Go
Stars: ✭ 20 (+42.86%)
Mutual labels:  chess-engine, chess
rustic
Rustic is a chess engine. It is written from scratch, in the Rust programming language.
Stars: ✭ 68 (+385.71%)
Mutual labels:  chess-engine, chess
Zerofish
An implementation of the AlphaZero algorithm for chess
Stars: ✭ 34 (+142.86%)
Mutual labels:  chess-engine, chess
elephantfish
elephantfish: 一个只有124行的中国象棋引擎
Stars: ✭ 129 (+821.43%)
Mutual labels:  chess-engine, chess
renpy-chess
A chess GUI built with Ren'Py, python-chess, and Stockfish. Version 2.0 of https://github.com/RuolinZheng08/renpy-chess-engine
Stars: ✭ 36 (+157.14%)
Mutual labels:  chess-engine, chess
uci
A thin wrapper on a uci chess engine
Stars: ✭ 33 (+135.71%)
Mutual labels:  chess-engine, chess
bot-o-tron
Try out lichess' bot interface
Stars: ✭ 36 (+157.14%)
Mutual labels:  chess-engine, chess
Sunfish
Sunfish: a Python Chess Engine in 111 lines of code
Stars: ✭ 2,254 (+16000%)
Mutual labels:  chess-engine, chess
fastchess
Predicts the best chess move with 27.5% accuracy by a single matrix multiplication
Stars: ✭ 75 (+435.71%)
Mutual labels:  chess-engine, chess
lila-tablebase
Tablebase server
Stars: ✭ 51 (+264.29%)
Mutual labels:  chess
tea-chess
A chess-themed tutorial on writing an SPA in Bucklescript-TEA
Stars: ✭ 28 (+100%)
Mutual labels:  chess

ConvChess

Convolutional Neural Networks learn chess moves

I must admit chess has already been solved and using an approximate solution to evaluate the board or moves is not the best idea. However, I wanted to try how game playing with pattern recognition methods works e.g. in recent success on Go. Feel free to use/reuse the code. There are some good insights in the ipython notebooks so as to investigate the evaluation function and action prediction models. You can always post an issue if you feel something is wrong/outdated/missing.

The description of the model and other relevant details can be found in the docs directory.

The source code consists of four different parts:

  1. Data Generation: There are two steps to generating the data (in the form of matrices and labels/scores) from the pgn format set of games:
    • Run get_train_data_large.py with appropriate options. The options list can be viewed by: python get_train_data_large.py -h . This will convert the pgn formats to the matrices and labels/scores format into npy files in the specified folder.
    • Then using the output folder in the generated files, run the file npy_to_hdf5.py. An example case is: python npy_to_hdf5.py --dir npy_files --regr. Now you are done with the dataset generation. You will now have a folder full of hdf5 files that can be used as training data for the convolutional neural networks in one of the next parts.
  2. Training CNNs for move prediction: We divide the task of predicting moves on a given chess board into two parts: Predicting the piece and then predicting the move given the piece. The data generated in part 1 is organized in a way that can be used to train 7 different networks-- one for the piece predictor and rest 6 for each of the piece types. For training, the best way is to run caffe directly using one of the solvers in the directory src/net/solvers. The solvers are named according to their task. To train using caffe: path/to/caffe/caffe train --solver net/solvers/piece_solver.prototxt --snapshot 5000 --. Or you can use the file train.py with relevant arguments (check using python train.py -h.
  3. Training CNNs for move evaluation: This directly uses regression training on a CNN to learn the evaluation function as specified while generating the data. The code uses Keras (a deep learning library based on Theano). To start the training, you will need to run regression_train.py. You can change the network configuration inside the regression_train.py file.
  4. Playing: All the code related to playing chess against a human being or sunfish is present in the src/play directory. The files playN.py contain different scenarios of playing against a computer or a human being. Relevant comments are given in the code itself.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].