Giter Site home page Giter Site logo

chessai's Introduction

Chess AI

Developed by Ryan Pope for EECS 649 (Intro to Artificial Intelligence).

Overview

Here is a link to a youtube video explaining my code: https://www.youtube.com/watch?v=M9VLWW0a1_4

This repo contains several Jupyter notebooks to explore chess algorithms using python. I utilized the python library python-chess in order to execute and manage all of the chess backend features. I began with simple random move generation and slowly upgraded to using a minimax algorithm with basic material evaluation to determine best moves,

After researching about AlphaZero and Leela Chess Zero, I tried to implement some similar approachs utilizing UCT Monte Carlo Tree Search to generate move sequences and a neural network that was trained to evaluate different positions using previous stockfish evaluations from the lichess dataset.

Data

I downloaded the May 2015 Lichess dataset from https://database.lichess.org . I then filtered games by Elo of both players greater than 1800 to generate "better" play and I used only games with the stockfish evaluations. I iterated over the moves of the game and created frames from the PGNs where I utilized an array of size 64 to store the encoded board.

Files

filtered_games.pgn is the filtered PGN dataset that I utilized for training.

preprocessed.csv is a CSV file containing the data as arrays of 64 values plus the evaluation for the state.

ChessExploration.ipynb is a Jupyter notebook with basic algorithms such as Minimax.

Preprocessing.ipynb converted the PGN dataset into the arrays stored in the csv.

NeuralNetTraining.ipynb trained the neural network.

MCTSChess.ipynb implements the Monte Carlo Tree Search and utilizes the Neural Net to evaluate positions.

Depenedencies

  • Keras
  • Tensorflow
  • Numpy
  • Scikit-learn
  • python-chess

Key Resources

Papers:

Articles:

Code Influences:

Other:

chessai's People

Contributors

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