Code Monkey home page Code Monkey logo

exit-chess's Introduction

Root-Parallel Expert Iteration in C++

This is a fast, root-parallel C++ implementation of the Expert Iteration algorithm proposed by Anthony et al. The implementation is generic in a choice of a Markov decision process as well as your choice of an apprentice.

The current version of the program presents a UCI interface to be used with Lichess as a chess bot. The apprentice used in the chess bot is a trivial one, which evaluates every state to 0 and performs no training. With the trivial apprentice, the Expert Iteration algorithm degenerates to plain Monte-Carlo Tree Search. Even with pure MCTS, the program has managed to beat a human player :) A better apprentice model is in progress.

Running it

You will need to add libtorch as a submodule under include/ and build it with CMake.1 You need to have SConstruct installed. The following incanation builds and runs the program on macOS and Linux.

git clone https://github.com/jaykru/mcts-chess
cd mcts-chess
scons && ./run.sh

Usage

The main executable presents a UCI chess interface. You can play manually with this, but it's recommended that you instead hook it up with lichess-bot. Some tweaking to lichess-bot is required to make it tolerant of long thinking time when using high iteration counts for the tree search.

License

Copyright Jay Kruer 2023. You probably won't want to use the code (yet) but contact me if you do. I haven't decided on a license yet.

Footnotes

  1. I'd like to make this less manual and kludgy in the future, but this is a hobby project for now... โ†ฉ

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.