Skip to content

StephAO/guerilla

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Guerilla

Guerilla is a deep learning chess engine developed by Miguel and Stephane Aroca-Ouellette. More details on the project can be found in the following blog posts: Part 1, Part 2, and Post-Mortem.

The project was developed in Python 2.7 on Linux systems (Ubuntu). All instructions below are for linux systems. If someone gets it running on a different operating system successfully, a pull request with the instructions would be appreciated.

To Play

Install

  • Install Tensorflow 1.x.x (https://www.tensorflow.org/install/)
  • Install Pip package: pip install --user Guerilla
  • Due to Pip package size limits, the version of Guerilla provided by Pip is weaker than the one in this repo. To make it as strong simply copy over the network weight and hyperparameters:
    • Extract weights: tar -xzvf guerilla/data/weights/default.tar.gz
    • Copy over weights: mv guerilla/data/weights/default.p ~/.local/lib/python2.7/site-packages/guerilla/data/weights/default.p
    • Copy over hyperparameters: mv guerilla/data/hyper_params/neural_net/default.yaml ~/.local/lib/python2.7/site-packages/guerilla/data/hyper_params/neural_net/default.yaml

Play

  • Add Guerilla to your favorite UCI Compatible chess GUI (after the pip installation, the command for the GUI to run Guerilla is Guerilla).
  • Currenlty only supports time limit and depth limit (depth 4 ~= 1 minutes per move).
  • Example using Chess Arena (http://www.playwitharena.com/):
    • Run Chess Arena
    • In the Menu Bar (top bar), select Engines->Install New Engine...
    • Go to ~/.local/bin/ (or \usr\local\bin\ if installed without the --user option) and select Guerilla
    • A window asking UCI or Winboard should appear. Select UCI.
    • In the Menu Bar (top bar), select Levels->Adjust.
    • In the window, choose either Fixed search depth or Time per move and input desired value.
    • In the Menu Bar (top bar), select File->New.

Improve Guerilla

Dependencies

Packages and programs required for things to work.

Required Packages to Play

  • python-chess:
    • pip install --user python-chess
  • tensorflow 1.0:
  • numpy
    • sudo apt-get install python-numpy
  • ruamel.yaml <= 0.15:
    • pip install --user ruamel.yaml

Required Packages to Train

  • stockfish:
    • sudo apt-get install stockfish
  • psutil (used when calling stockfish):
    • pip install --user psutil

How to Train

  1. Go to guerilla directory (outer guerilla directory)
  • cd /path/to/guerilla
  1. Get fens:
  • python -m guerilla.train.chess_game_parser
  1. Get stockfish values:
  • python -m guerilla.train.stockfish_eval
  1. Train by running:
  • python -m guerilla.train.teacher <number hours (optional)> <number minutes (optional)> <number seconds (optional)>

If you need further information on development, feel free to contact us.

How to Test

  1. Go to guerilla directory (outer guerilla directory)
  • cd /path/to/guerilla
  1. Choose test to run:
  • data_test: Tests data transformations.
  • play_test: Tests all functionality required to play the game.
  • train_test: Tests all the functionality required to train guerilla.
  • all_test: Tests all of the above
  1. Run test:
  • python -m tests.<test_chosen>

License

Licensed under MIT license. Refer to LICENSE.md.

Authors

  • Miguel Aroca-Ouellette: mig_ao[at]live[dot]com
  • Stephane Aroca-Ouellette: stephanearocaouellette[at]gmail[dot].com
  • Google LLC

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published