GithubHelp home page GithubHelp logo

tailuge / experiments Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 41.8 MB

ChessGPT experiments

License: MIT License

Jupyter Notebook 80.28% Python 12.87% Shell 0.98% Dockerfile 0.39% JavaScript 5.48%
chess transformers colab-notebook lichess

experiments's Introduction

Experiments

Open in Colab Open in Gitpod CodeFactor

ChessGPT

  • Tranformer decoder neural network applied to PGN chess move sequences
  • Trained from human lichess.org games
  • Inference using WebAssembly ONNX model in browser

If large language models internalise the world in an effort to predict the next word with transformer networks, can they internalise chess by predicting PGN 'words' from real games?

I think this would work but with only ~10000 parameters the results are hopeless. Maybe someone who understands transformer architecture will take this idea to a real implementation someday.

Onnx model for inference in web page deployed at https://tailuge.github.io/experiments/dist/index.html

Dev

yarn deps
yarn upgrade -L
yarn shellcheck
yarn prettify
yarn black
yarn markdownlint

Setup

Create a python virtual environment and install dependencies

yarn setup

Get a few thousand games from lichess.org database and sanitize

yarn fetch

Train

Model is trained using python with pip installed dependencies numpy, torch and onnx (see requirements.txt)

yarn train

Inference

In browser inference from ONNX model

yarn dev
yarn serve

Plans

  • add harness to produce legal next move by retrying or selecting random legal move if no legal move produced by model.
  • hyper parameter tuning (on RaspberryPi 4b)
  • host on render.com free tier and connect to lichess
  • allow for hosting provider to do inference on webpage (via websocket)

experiments's People

Contributors

tailuge avatar

Watchers

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