Skip to content

paul-ada/drl-chess

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Playing Chess through Deep Reinforcment Learning

About

This is a 10-day project from Le Wagon's ML course.

We use the PettingZoo library for our agent's reinforcement learning process: https://github.com/Farama-Foundation/PettingZoo

We also introduce the possibility to calculate move-by-move rewards using the Stockfish chess engine (instead of game-by-game rewards from PettingZoo Classic): https://github.com/official-stockfish/Stockfish

Settup

Clone the repo and install libraries

With pyenv:

git clone [email protected]:marina-kb/drl-chess.git && cd "$(basename "$_" .git)"
pyenv virtualenv drl-chess
pyenv local drl-chess
pip install --upgrade pip
pip install -r requirements.txt

Install Stockfish

With Homebrew:

brew install stockfish

Otherwise:

sudo apt-get -y install stockfish

Basic usage

See the Makefile to execute basic commands from main.py.

With the main() function, you can choose two agents in the agt key and modify various game parameters inside CFG.init().

You can also generate multiple batches of games to be saved as .pkl with the gen_data() function. Then, train and evaluate your model with this pre-generated data using the load_agent() function.

Roadmap

  • Optimize batch size and improve experience replay.
  • Evaluate positions and implement Monte Carlo tree search (MCTS),
    also see Silver et al. (DeepMind).

About

Chess with Deep Reinforcement Learning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.3%
  • Makefile 0.7%