GitXplorerGitXplorer
N

alphagozero

public
56 stars
16 forks
8 issues

Commits

List of commits on branch master.
Verified
19e03ee9be022c98af3d7e88d5460d15a81ec62b

Merge pull request #38 from Narsil/dependabot/pip/werkzeug-3.0.1

NNarsil committed a year ago
Verified
84713db5093e150e53acbfc985e05d02eafd6661

Bump werkzeug from 2.2.3 to 3.0.1

ddependabot[bot] committed a year ago
Verified
cec755e484e17782385273ca0a6043716beaa0b8

Merge pull request #36 from Narsil/dependabot/pip/scipy-1.10.0

NNarsil committed a year ago
Verified
947d16d13f79706178633ab8f7ece3587685a96b

Bump scipy from 1.0.0 to 1.10.0

ddependabot[bot] committed a year ago
Verified
f9a15cce35e43f5ba42e4956ae44c3e64bc6d94a

Merge pull request #37 from Narsil/dependabot/pip/pygments-2.15.0

NNarsil committed a year ago
Verified
8922131951604fde249c4e7e3041f172dc049789

Bump pygments from 2.7.4 to 2.15.0

ddependabot[bot] committed a year ago

README

The README file for this repository.

AlphaGo Zero

This is a unofficial reimplementation in Keras (Tensorflow backend) of AlphaGo Zero It is work in progress. The aim is to have simple code. Written in Python 3.

Installation and run

Install the dependencies and devDependencies and start the server.

$ pip install -r requirements.txt # Requirements use tensorflow-gpu, feel free to use the CPU version.
$ python main.py

The main program will loop indefinitely, hopefully succeeding a building a stong model for Go play. So far everything runs in one big loop. It might and up being split in the future in multiple threads/processes/workers.

If you want to play against a model to check its strength, you can use it's GTP support. Just add the gtp.py file as an engine. Crude implementation for now.

Configuration

Everythin is set in the conf.py file. All original papers parameters are described in the comments, but for a single machine, single GPU machine, you should definitely stick to much lower parameters.

Whenever you change configuration you should use reset.sh. But be careful, it will ERASE ALL PREVIOUS DATA (models and self play, and tensorboard logs)

Model

Everything is implemented in Keras and should correspond to the specified model in the Original paper. You can see the graph in tensorboard

python main.py  # The model is immediately created, so you can Ctrl+C pretty fast if you just want to check the graph
tensorboard --logdir=logs

Self Play

Implementations should correspond to what is described in the paper.

Train

I don't have 64 GPU workers as were used in the original implementation so for now, it just takes 64x the time than the original paper. Using Keras or TF to distribute the work is not planned.

Evaluator

The evaluator just runs games to check which model is best and saves the new model in best_model in case it ouranks the last best model

Development

Want to contribute? Pull Requests more than welcome.

TODOS:

  • Improve the tests (Right now basic gameplay functions are tested)
  • Find ways to distribute the work.