Giter Club home page Giter Club logo

nlp-chess's Introduction

thumbnail widget
text
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 White <MOVE_SEP> [MASK]
example_title
Empty Board
text
6Q1/5k2/3P4/1R3p2/P4P2/7Q/6RK/8 b - - 2 60 Black <MOVE_SEP> [MASK]
example_title
Late Game Board

BertHarmon

Research done at Johns Hopkins University by Michael DeLeoiu-13

Contact: [email protected]

Links

Github

HuggingFace

Introduction

BertHarmon is a BERT model trained for the task of Chess.

IMG_0145

Sample Usage

from transformers import pipeline
task = pipeline('fill-mask', model='BertHarmon')
task("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 White <MOVE_SEP> [MASK]")

The base string consists of the FEN_position followed by the player color and a move seperator. Finally with the [MASK] token. The mask token is the algebraic notation for a chess move to be taken givent the current board state in FEN Notation

Install

Build Stockfish

cd stockfish_build
. ./build.sh

Then install the requirements for either a CPU machine or CUDA.

CPU Machine

pip install -r requirements.txt

CUDA Machine

pip install -r requirements-cuda.txt

BERT Training

All our training scripts utilize jupyter notebooks.

jupyter lab

Training requires CUDA 11.3

NIM

Reference the Train BERT NIM notebook

Chess

Reference the Train BERT Chess notebook

Docker

Using docker is optional, it can help to standardize your environment. The reqs here are not that complicated though.

DOCKER REQUIREMENTS

docker-compose -- 1.27 docker -- 20.10.12

Setup

  1. Make sure docker and docker compose are installed.
  2. For a GPU enabled machine, install nvidia runtime
    1. LINUX: sudo apt-get install nvidia-docker2 -y
    2. Windows: TODO

Training

Build Locally

CPU Machine

docker compose up --build

OR

GPU Machine

docker compose up --build -f docker-compose-gpu.yml

Use the remote image

docker compose up -f docker-compose-remote.yml

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.