Giter Club home page Giter Club logo

chess-ai's Introduction

Chess-AI

Chess-AI trained using deep learning techniques with PyTorch Lightning and a dataset of chess positions and evaluations from Lichess.

Overview

This project trains a neural network to evaluate chess positions. The model is trained on a dataset of chess positions and their corresponding evaluations, obtained from Lichess. The dataset contains over 37 million evaluations, providing a rich source of data for training the model.

Installation

  1. Clone the repository:
    git clone https://github.com/ameykunte/Chess-AI.git
    
  2. Install the required dependencies:
    pip install peewee pytorch-lightning
    

Dataset

The dataset used in this project is the "2021-07-31-lichess-evaluations-37MM.db" SQLite database, which contains chess positions in FEN notation and their corresponding evaluations. You can download the dataset using the following command:

wget https://storage.googleapis.com/chesspic/datasets/2021-07-31-lichess-evaluations-37MM.db.gz
gzip -d "2021-07-31-lichess-evaluations-37MM.db.gz"

Model

The neural network model is implemented using PyTorch Lightning. It consists of multiple linear layers with ReLU activations, with the number of layers being configurable. The model is trained to minimize the L1 loss between the predicted and actual evaluations.

Training

To train the model, simply run the following command:

python train.py

You can modify the configs variable in the train.py script to experiment with different configurations of the model, such as the number of layers and batch size.

Evaluation

The trained model can be evaluated on a set of random chess positions from the dataset. The evaluation includes the predicted evaluation, actual evaluation, and the loss. Additionally, the positions can be visualized using the SVG format.

Conclusion

This project demonstrates how to train a neural network to evaluate chess positions using PyTorch Lightning and a large dataset from Lichess. The model can be further improved and customized to suit different requirements and applications in the field of chess AI.

chess-ai's People

Contributors

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