Coder Social home page Coder Social logo

tak's Introduction

AlphaTak

About

An implementation of AlphaZero for the abstract strategy board game Tak.

The goal of this project is to advance the state of the art in Tak bots, increase the skill level of the game, and to experiment with the Rust Machine Learning ecosystem.

I used tch-rs crate (wrapper for libtorch) as my machine learning library. I experimented with tensorflow as well, but I found the documentation lacking in many aspects. Overall, the quality of resources for machine learning in Rust is very poor.

Building

It is strongly recommended that you manually install the C++ library PyTorch (libtorch) v1.11.0. The instructions for installing can be found here.

Then you can just run cargo build --release in the tak directory. This will build all the packages in the workspace. If you want to build a specific one instead, you can specify like this: cargo build --release -p <package-name>.

Brief summary of what each package does:

  • tak library: implementation of Tak including move generation and parsing of PTN and TPS
  • alpha-tak library: implementation of AlphaZero, MCTS, the network
  • train binary: training the network with self-play
  • analysis binary: interactive local analysis
  • playtak binary: for running the bot on playtak

tak's People

Contributors

alion02 avatar allybag avatar mortenlohne avatar viliamvadocz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tak's Issues

Racy file write

tak/playtak/src/main.rs

Lines 90 to 93 in c3f0fe9

// create analysis file
if let Ok(mut file) = File::create(format!("analysis_{}.ptn", sys_time())) {
file.write_all(player.get_analysis().to_ptn().as_bytes()).unwrap();
}

These lines are not guaranteed to run -- once the main thread ends, all background threads are eligible to be killed immediately.

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.