Coder Social home page Coder Social logo

alphago-weak_3y38's Introduction

AlphaGoWeak is go game bot based on deep learning. Her principle is similar to that of AlphaGo but can run in personal computer easily. I made her just for fun. She has some interesting specialties as follows:

  • Downloading, unpacking and parsing SGF (Smart Game Format) data automatically.
  • Fully Win32, Linux, Mac platform support.
  • Multiprocessing optimization.
  • GPU computing.
  • GUI support.
  • Support for GTP (Go Text Protocol).
  • Support for command line tools.
  • Reinforcement learning.
  • Support for MCST (Monte Carlo Search Tree).

Model Structure

AlphaGo Weak v1.0

The model structure is generated by Keras. This kind of network structure is very efficient, and can work half a time.

The input of chessboard grid contains 11 features, which is few but very representative. Quite a lot of scholars like a large number of feature layers, and this will make the training network get twice the result with half the effort. But I think too many feature layers will not only reduce the efficiency of network operation, but also exert too much human influence and make the network rigid. So I used a few feature layers. Although the accuracy of prediction is less than that of multi feature layer, the accuracy of policy network can still reach about 42% just after a few hours of training. Considering that reinforcement learning will be carried out next, the loss of accuracy when using less feature inputs is acceptable because it runs faster.

Feature name Number of planes Description
Stone color 2 Whether there is next player / opposite player's stone.
Valid position 1 Whether there is a valid position.
Player Liberties 4 (1,2,3,>=4) Number of liberties (empty adjacent points) of the player's stones have.
Opposite Liberties 4 (1,2,3,>=4) Number of liberties of the opposite player's stones have.

Training

  1. Assume you are in <project_folder>.

  2. Run command pip install -r requirements.txt to install prerequisites, assume you can use TensorFlow with GPU normally.

  3. Run command python main.py download --type u-go to download datasets from the Internet. If the network speed is too slow, you may need to use an accelerator. Mirroring is not supported currently.

  4. Run command python main.py train --init 4096 to train your model. The weights file is saved and loaded automatically.

  5. The default training logging directory is .data/model/alphago_weak_v0/logs. You can type tensorboard --logdir <log_folder> to see training history.

  6. More commands is not written because they are experimental at now.


PolicyNetwork Accuracy

Usage

Currently the project for AlphaGoWeak has not been finished, so it can only be executed by modifying the source code.

Reference

alphago-weak_3y38's People

Contributors

invoker-bot avatar trellixvulnteam 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.