Git Product home page Git Product logo

UnrealGo

UnrealGo is a experimental implementation of alphagoZero in C++. It's developed with MCTS and deep reinforcement learning. It can be trained from scratch.

Dependencies

Boost - 1.64+
http://www.boost.org/

# build boost from source
$ ./bootstrap.sh
$ ./b2
# set LIB_INSTALL_DIR
$ cp -rf stage/lib/ ${LIB_INSTALL_DIR}
# edit and add lib directory to file /etc/ld.so.conf
$ sudo ldconfig

ZMQ - 4.2.2

$ git clone https://github.com/zeromq/libzmq.git
$ sudo apt-get install autogen autoconf libtool
$ ./autogen.sh
$ ./configure
$ ./make
$ ./make install

build tensorflow cmake interface

tensorflow cmake interface
Assume $PROJ_WORKSPACE is your project home directory

# clone tensorflow
$ cd $PROJ_WORKSPACE
$ git clone https://github.com/tensorflow/tensorflow.git
# git checkout to desired version(e.g. 1.6) if you like

# build interface
$ cd $PROJ_WORKSPACE
$ git clone https://github.com/unrealgo/tensorflow_cmake_interface.git
$ cd tensorflow_cmake_interface
$ mkdir build
$ cd build
$ cmake -DTENSORFLOW_SHARED=ON -DTENSORFLOW_SOURCE_DIR="$PROJ_WORKSPACE/tensorflow" ..
$ make
$ make install

After finishing build, the interface is installed at TensorflowCC="$PROJ_WORKSPACE/tensorflow_cmake_interface/build/lib/cmake/TensorflowCC"

Build UnrealGo

Build UnrealGo with tensorflow cmake interface:

$ git clone https://github.com/unrealgo/unrealgo.git
$ mkdir build
$ cd build
$ cmake -DTensorflowCC="$PROJ_WORKSPACE/tensorflow_cmake_interface/build/lib/cmake/TensorflowCC" ../
$ make -j4

Run UnrealGo

The binary is installed at $PROJ_WORKSPACE/unrealgo/bin. To run unrealgo, the network checkpoint(weights) is needed. A bootstrap checkpoint of 20 residual block is provided, decompress and copy to bin/

# first copy config/dlcfg-19 to bin/
$ cd $PROJ_WORKSPACE/
$ cp config/dlcfg-19 bin/

$ tar xvf bootstrap.tar.gz
$ mv bootstrap-ckpt.* bin/

# start unrealgo, type selfplay to start self play.
$ ./unrealgo
 selfplay

Config

meta_graph: path to metagraph
checkpoint: prefix of checkpoint files
nn_input: input name of the model inputs
nn_outputs: policy:value name pairs of the model outputs
value_transform: transform formula for network value output

0: v = v
1: v = -v
2: v = 1-v

reuse_searchtree: whether to reuse search tree

GUI

Sabaki

$ git clone https://github.com/SabakiHQ/Sabaki.git
$ cd Sabaki/dist/linux-unpacked
$ ./sabaki
# after sabaki is started, select [Engines]->[Attach] to attach unrealgo binary.

Neural Network Training

The hard part is neural network training. UnrealGo run in client mode by default, allowing user to run command 'selfplay' or 'clienteval'

  1. command 'selfplay' executes mcts search by single player with identical network weight
  2. command 'clienteval' executes mcts search by two players with different network weights.

The generated selfplay data or evaluation result will be synced to server for training/update.

License

UnrealGo is licensed under GPLv3 or later.

liuke's Projects

eigen icon eigen

Github mirror of the official Eigen's repository (https://bitbucket.org/eigen/eigen)

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.