Giter Club home page Giter Club logo

alphagozero's Introduction

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.

alphagozero's People

Watchers

 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.