Skip to content

A neural network model designed to rank chess positions♟️

Notifications You must be signed in to change notification settings

andr3wV/ChessTransformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess Position Evaluation Transformer

Please refer to my ChessEngine repository to view an implementation of the neural network.

Purpose

This repository provides the implementation of a neural network model designed to rank chess positions from winning to losing. It includes a decoder-only transformer and a tokenizer. The tokenizer processes chess positions in FEN notation, and the model predicts their winning probabilities.

  • Data Source: Lichess Stockfish Data
  • Preprocessing: Chess positions in FEN notation are evaluated in centipawns, which are then converted to winning percentages as described in the Lichess Accuracy page. The winning percentage is binned following the method used in the DeepMind Paper.

Note: This implementation is optimized for GPU. Running it on a CPU is not recommended.

Setup Instructions

  1. Create a Virtual Environment and Install Prerequisites

    python -m venv venv
    source venv/bin/activate   # On Windows use `venv\Scripts\activate`
    pip install -r requirements.txt
    
  2. Download and Preprocess Data

    python preprocess.py
    
  3. Train the model

    python train.py
    

Post-Training

After training the model and saving its weights, you need to integrate it into a chess engine. Refer to my ChessEngine repository for instructions on this integration.

About

A neural network model designed to rank chess positions♟️

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages