Giter Site home page Giter Site logo

ml-chess's Introduction

ml-chess

Using PyTorch to compensate for my bad chess. An undocumented mess, oops!

I started this project a year(s?) ago and then left it hanging. It does contain a working chess engine (at least it used to... on my machine!) and I do recall playing against it. In complex middle games the engine would often out manuever me. Near the endgame it would struggle and fail. This is because the engine is good at evaluating static positions but only performes a few move rollout with simple Minimax.

This repo contains SPAGHETTI CODE from me messing around with PyTorch and chess algorithms. In this project, I use PyTorch to train various models to mimic stockfish evaluations. ResNetEvaluator() in ChessPositionEvaluator.py is not appropriately named, the current version looks to be using a simple convolution encoder and a linear decoder, no skip layers.

Here is the layout of the repo to the best of my memory:

  • ChessPositionEvaluator.py is for training models
  • chess_utils.py is for generating training data. The training data is board states with score labels generated by a UCI-compliant engine (Stockfish in this case.)
  • board_utils.py helper functions, testing; get_bitboards() is used to convert chess game states into tensors for PyTorch.
  • main.py facilitates playing actual games using the ML-evaluation engine + Minimax as well as using other engines.
  • ResNet.py and ResNetEvaluator.py have been excluded because I'm not sure if I ever used them for training chess evaluator models.

ml-chess's People

Contributors

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