CAFE

바둑

leela-zero

작성자진세|작성시간17.10.28|조회수961 목록 댓글 0


https://github.com/gcp/leela-zero

http://zero.sjeng.org/


1단계93750100K초보
2단계593750600K중급
3단계21875002M
4단계1575000015M마스타
5단계3000000030M제로


=================

Unzip and launch autogtp.exe.


You can specify the -g option to indicate the amount of games to 

play at once, i.e. autogtp.exe -g 4 will play 4 games at once,

using 4 cores. This might make your computer less responsive, so

autogtp defaults to 1 core only.


With the option -k <subdirectory-name> the games can be saved in a 

subdirectory.


================


=================


Leela Zero is available from: Github.

Autogtp will automatically download better networks once found.
Not each trained network will be a strength improvement over the prior one. Patience please. :)

2017-11-21 We are now on 5 blocks x 64 filters, so the speed of the games will drop.
2017-11-20 Leela Zero 0.6 + AutoGTP v4.

View your most recently submitted game.

628 clients in past 24 hours, 199 in past hour.
756602 total submitted games. (57338 in past 24 hours, 2708 in past hour.)

Archive of past networks.
Raw training data and SGF files.
Strength graph.


==================


20171206 

756602 total submitted games



====================


http://zero.sjeng.org/view/ddad8ea86ae2cf04b0bd3f4bafdd4c3132cad64590acac7f711c2267a66f64c8



========================


Go engine with no human-provided knowledge, modeled after the AlphaGo Zero paper.
C++Other
Latest commit 656467e 5 hours ago@gcp gcp Add "dump_training" command. 

 README.md

What

A Go program with no human provided knowledge. Using MCTS (but without Monte Carlo playouts) and a deep residual convolutional neural network stack.

This is a fairly faithful reimplementation of the system described in the Alpha Go Zero paper "Mastering the Game of Go without Human Knowledge". For all intents and purposes, it is an open source AlphaGo Zero.

Wait, what

If you are wondering what the catch is: you still need the network weights. No network weights are in this repository. If you manage to obtain the AlphaGo Zero weights, this program will be about as strong, provided you also obtain a few Tensor Processing Units. Lacking those TPUs, I'd recommend a top of the line GPU - it's not exactly the same, but the result would still be an engine that is far stronger than the top humans.

Gimme the weights

Recomputing the AlphaGo Zero weights will take about 1700 years on commodity hardware, see for example: http://computer-go.org/pipermail/computer-go/2017-October/010307.html

One reason for publishing this program is that we are setting up a public, distributed effort to repeat the work. Working together, and especially when starting on a smaller scale, it will take less than 1700 years to get a good network (which you can feed into this program, suddenly making it strong). Further details about this will be announced soon.

I just want to play right now

A small network with some very limited training from human games is available here: https://sjeng.org/zero/best.txt.zip.

It's not very strong right now (and it's trained from human games, boo!). It will clobber gnugo, but lose to any serious engine. Hey, you said you just wanted to play right now!

I plan to update this network with more or better training when available - just feeding it into this program will make it stronger. Unzip it and specify the weights.txt file on the command line with the -w option.

Compiling

Requirements

Example of compiling and running - Ubuntu

# Test for OpenCL support & compatibility
sudo apt install clinfo && clinfo

# Clone github repo
git clone https://github.com/gcp/leela-zero
cd leela-zero/src
sudo apt install libboost-all-dev libopenblas-dev opencl-headers ocl-icd-libopencl1 ocl-icd-opencl-dev
make
cd ..
wget https://sjeng.org/zero/best.txt.zip
unzip https://sjeng.org/zero/best.txt.zip
src/leelaz --weights weights.txt

Usage

The engine supports the GTP protocol, version 2, specified at: https://www.lysator.liu.se/~gunnar/gtp/gtp2-spec-draft2/gtp2-spec.html

Add the --gtp commandline option to enable it. You will need a weights file, specify that with the -w option.

All required commands are supported, as well as the tournament subset, and "loadsgf". The full set can be seen with "list_commands". The time control can be specified over GTP via the time_settings command. The kgs-time_settings extension is also supported. These have to be supplied by the GTP 2 interface, not via the command line!

Sabaki (http://sabaki.yichuanshen.de/) is a very nice looking GUI with GTP 2 capability. It should work with this engine.

Weights format

The weights file is a text file with each line containing a row of coefficients. The layout of the network is as in the AlphaGo Zero paper, but the number of residual blocks is allowed to vary. The program will autodetect the amount on startup.

  • Convolutional layers have 2 weight rows:
    1. convolution weights
    2. channel biases
  • Batchnorm layers have 2 weight rows:
    1. batchnorm means
    2. batchnorm variances
  • Innerproduct (fully connected) layers have 2 weight rows:
    1. layer weights
    2. output biases

You might note there are 18 inputs instead of 17 as in the paper. The original AlphaGo Zero design has a slight imbalance in that it is easier for the white player to see the board edge (due to how padding works in neural networks). This has been fixed in Leela Zero. The inputs are:

1) Side to move stones at time T=0
2) Side to move stones at time T=-1  (0 if T=0)
...
8) Side to move stones at time T=-8  (0 if T<=7)
9) Other side stones at time T=0
10) Other side stones at time T=-1   (0 if T=0)
...
16) Other side stones at time T=-8   (0 if T<=7)
17) All 1 if black is to move, 0 otherwise
18) All 1 if white is to move, 0 otherwise

The zero.prototxt file contains a description of the full 40 residual layer design, in (NVIDIA)-Caffe protobuff format. It can be used to set up nv-caffe for training a suitable network. The zero_mini.prototxt file describes the 12 residual layer case that was used for the example supervised network listed in "I just want to play".

Training

Getting the data

At the end of the game, you can send Leela Zero a "dump_training" command, followed by the winner of the game (either "white" or "black") and a filename, e.g:

dump_training white train.txt

This will save (append) the training data to disk, in the format described below. Training data is reset on a new game.

File format

The training data consists of a file with the following data, all in text format:

  • 18 lines of 361 0's or 1's, corresponding to the inputs from the previous section
  • 1 line with 362 floating point numbers, indicating the search probabilities (visit counts) at the end of the search for the move in question. The last number is the probability of passing.
  • 1 line with either 1 or -1, corresponding to the outcome of the game for the player to move

Running the training

For training a new network, you can use an existing framework (Caffe, TensorFlow, PyTorch, Theano), with a set of training data as described above. You still need to contruct a model description (2 examples are provided for Caffe), parse the input file format, and outputs weights in the proper format.

Supervised learning

For experimenting with supervised learning, you'll need a tool that takes SGF, extracts the input features as described above, the move that was played and whether the side to move won, and runs the training. Leela Zero doesn't have this code yet, so your best bet is to modify Mugo (https://github.com/brilee/MuGo), which is fairly accessible Python code that is ready to interface to TensorFlow.

Todo

  •  List of package names for more distros
  •  A real build system like CMake would nice
  •  Provide or link to self-play tooling
  •  CPU support for Xeon Phi and for people without a GPU
  •  Faster GPU usage via batching
  •  Faster GPU usage via Winograd transforms
  •  CUDA specific version using cuDNN
  •  AMD specific version using MIOpen
  •  Faster GPU usage via supporting multiple GPU (not very urgent, we need to generate the data & network first and this can be done with multiple processes each bound to a GPU)

License

The code is released under the GPLv3 or later, except for ThreadPool.h, which has a specific license (zlib License - compatible with GPLv3) mentioned in that file.



다음검색
현재 게시글 추가 기능 열기

댓글

댓글 리스트
맨위로

카페 검색

카페 검색어 입력폼