Coder Social home page Coder Social logo

ble-b / edgars-chess-project Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 13.93 MB

Chess game including state-of-the-art GUI, lichess.org game selection interface and review mechanic and a simple computer opponent to play against.

License: GNU General Public License v3.0

Python 100.00%
python pygame pyqt5 general-adversarial-network chess-game chess-engine chess-ai chessboard lichess game-reviews

edgars-chess-project's Introduction

Edgar's Chess Project

This is a chess game including a state-of-the-art GUI, a lichess.org game selection interface and review mechanic as well as a simple computer opponent to play against - based on a NegaMax algorithm with alpha-beta-pruning and some tweaks regarding positional awareness on the board. General Adversarial Network (GAN)-based EdgarAI implementation to follow as soon as the model has been fully trained.

In order to run the program, run main.py in a python 3 environment with pygame, pyqt5, berserk and chess installed. You will notice that pyqt5 throws a couple of errors (at least when combined with Spyder 5) and all in all this environment is slightly tedious to set up in conda-based python 3.8. In order to train the EdgarAI GAN model, tensorflow 2.5 is required. It is also recommended to install CUDA and cudnn (for my Windows 10 64 machine CUDA 11.2.2 and cudnn 8.1.1 worked like a charm - however, GPU supported keras will require at least 6GB of GPU RAM for this model, potentially more). Either way, training the model may easily take up to 1.5 months (yes, MONTHS) on a regular laptop without dedicated GPU, so please do it at your own risk.

Finally, in order to be able to use computer-based evaluations of a given position on the chess board, I implemented an evaluation button which triggers stockfish 13. Hence, running the program properly requires a distribution of stockfish. Simply copy the source code (https://github.com/official-stockfish/Stockfish/releases/tag/sf_13) into the main folder and/or adjust the sf_13.py-file accordingly (currently set to "stockfish_13/sf_13.exe"). For more information on this amazing chess engine, check out the official website at https://stockfishchess.org/.

I received quite a bit of help from Eddie Sharick (unknowingly) in his YouTube tutorial series on how to program a chess game in python (as mentioned in the respective files; check out his playlist here: https://youtube.com/playlist?list=PLBwF487qi8MGU81nDGaeNE1EnNEPYWKY_. Remember to copy the underscore at the end). Also, the pandas_model file is not my own work. Furthermore, the GAN model is largely based on a model created by Victor S (https://towardsdatascience.com/magnusgan-using-gans-to-play-like-chess-masters-9dded439bc56), which in turn is based on the pix2pix GAN model (see https://github.com/phillipi/pix2pix). I had to tweak the data processing quite a bit in order to fit it to my data, but the model as such isn't mine.

edgars-chess-project's People

Contributors

ble-b avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.