Skip to content

Work in progress: A backgammon engine based on neural nets

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

oradwastaken/wildbg

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wildbg

wildbg is a backgammon engine based on neural networks. Currently, it's in a pre-alpha phase.

Goals

  1. Provide source code and documentation to train neural nets from zero to super human strength.
  2. Implement logic to evaluate all kind of backgammon positions: cubeless and cubeful equities, multi-ply evaluation, rollouts, etc.
  3. Make the backgammon engine accessible via an easy-to-use HTTP/json API.

A graphical user interface (GUI) is not part of this project.

Current state:

Topic 1: Neural nets

The training process consists of three steps, which are repeated in a loop:

  1. Find lots positions for later rollout. Currently, rather random self play is used; later we want to make sure to find all kind of positions, including backgames.
  2. Roll out these positions. Currently, only 1-ply rollouts are possible.
  3. Train neural networks based on the rollout data. Currently, a single net with one hidden layer is supported; later different (and deeper) nets for different game phases are planned.

Already implemented is:

  • Roll out a certain position 1296 times, multithreaded.
  • 202 neural net inputs similar to TD-Gammon, representing the raw board.
  • Find 100,000 random positions through self play for later rollouts.
  • Train a single neural net with one hidden layer via PyTorch and save the result as an ONNX file. The net has six outputs for winning/losing 1, 2 or 3 points.
  • Inference of that neural net in Rust via tract.

No neural network is committed to this repository. You can find the training progress and early rather weak networks here: https://github.com/carsten-wenderdel/wildbg-training

Topic 2: Backgammon logic

Currently only cubeless equities and moves are implemented. Cubes and cubeful equities are missing.

Topic 3: HTTP/json API

Ideation phase.

Contributing

Help is more than welcome! There are some smaller tasks but also bigger ones, see https://github.com/carsten-wenderdel/wildbg/issues. Currently, most needed is:

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Work in progress: A backgammon engine based on neural nets

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 97.0%
  • Python 3.0%