Giter Site home page Giter Site logo

guidogiacomomussini / reinfocementlearning--chess_engine Goto Github PK

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

Reinforcement Learning-based chess engine to solve chess finals.

License: MIT License

Python 26.99% Jupyter Notebook 73.01%
chess-engine python reinforcement-learning

reinfocementlearning--chess_engine's Introduction

Reinfocement-Learning__Chess-Engine

A reinforcement learning problem involving chess.

By me @GuidoGiacomoMussini and @mbarte.


In this project we implemented from scratch a small chess engine (white agent), which is able to play and win the final in the picture below against Stockfish 15.1.

Starting position.

In order for a user to run the code, he should download and install Stockfish.

Game results trend.


  • dynamics_br: implementation of the "backbone" of the game from scratch (dictionaries to define pieces and their moves, functions to retrieve possible moves and allowed future states, move pieces, etc.).

  • algorithm_utils_br: functions used by the learning algorithm scarsa_lambda_br.

  • scarsa_lambda_br: learning algorithm (sarsa-lambda, with epsilon-greedy approach).

  • executable_br: Jupyter Notebook to train the agent.

  • user_vs_scarsa_lambda_br: adaptation of scarsa_lambda_br replacing Stockfish with input from keyboard to allow users to play against our trained agent (one should download the Q_s_20t_1000g.pickle file, containing the "parameters" of the trained agent).

  • game_br: Jupyter Notebook to play against our trained agent.


  • Q_s_20t_1000g: Dictionary with the trained agent's parameters.

Future work: longer training against Stockfish with variable ELO, so that our model learns to play against a potential human user. In fact, in a sense it is easier to learn to beat Stockfish because of it's predictability, due to the constant performance of the best moves.

reinfocementlearning--chess_engine's People

Contributors

guidogiacomomussini 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.