Skip to content

Commit

Permalink
Update readme for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
lightvector committed Feb 27, 2019
1 parent c5e82c4 commit 810fade
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Research and experimentation with self-play training in Go. Contains a working implementation of AlphaZero-like training with a lot of modifications and enhancements, as well as a GTP engine that can run using neural nets trained via that process. Due to these enhancements, early training is immensely faster - self-play with a only few strong GPUs for between one day and several days (depending on your GPUs) should already be sufficient to reach somewhere in the range of strong-kyu up to mid-dan strength on the full 19x19 board.

I'll be releasing a paper shortly describing the major techniques used in KataGo. Many thanks to [Jane Street](https://www.janestreet.com/) for providing the computation power necessary to do a real run (as well as numerous many smaller testing runs). As described in the paper, although it was nowhere near as long as a "full" run, it still achieved close to LZ130 strength before it was halted. Models and training data from the run should also be available for download soon.
I'll be releasing a paper shortly describing the major techniques used in KataGo. Many thanks to [Jane Street](https://www.janestreet.com/) for providing the computation power necessary to do a real run (as well as numerous many smaller testing runs). As described in the paper, although it was nowhere near as long as a "full" run, it still achieved close to LZ130 strength before it was halted. See the [releases page](https://github.com/lightvector/KataGo/releases) for the final trained models. The self-play training data from the run has not yet been uploaded but should be available soon as well.

I hope to do more experiments at some point in the future and maybe some longer and even better runs testing out many more of the new ideas from LC0 and others that have surfaced in the last few months. KataGo also in theory supports Japanese rules self-play training, *including* details like "no points in seki" and "bent-four-in-the-corner is dead even if there are unremovable ko threats". Many short internal test runs did observe neural nets trained with these rules behaving consistent with learning Japanese rules, but it was not fully tested, since Japanese rules training was turned off in later and longer runs to reduce the complexity of moving parts for the paper. I hope to revisit this in the future.

Expand All @@ -12,7 +12,7 @@ This repo is essentially a continuation of https://github.com/lightvector/GoNN b
See LICENSE for the software license for this repo. License aside, informally, if do you successfully use any of the code or any wacky ideas explored in this repo in your own neural nets or to run any of your own experiments, I (lightvector) would to love hear about it and/or might also appreciate a casual acknowledgement where appropriate. Yay.

### Compiling the GTP engine and/or most of the self-play framework:
There is an implementation of MCTS in this repo along with a GTP engine and an simple SGF command-line analysis tool backed by the MCTS engine. Once compiled, they should work with any of the neural nets from KataGo that you can download from the releases page (TODO these will be uploaded shortly). Along with most of the self-play framework, all of this is written in C++.
There is an implementation of MCTS in this repo along with a GTP engine and an simple SGF command-line analysis tool backed by the MCTS engine. Along with most of the self-play framework, all of this is written in C++. Once compiled, you should be able to run it using the trained neural nets for KataGo that you can download from the releases page.

* Requirements
* CMake with a minimum version of 3.12.3 (https://cmake.org/download/)
Expand All @@ -27,7 +27,7 @@ There is an implementation of MCTS in this repo along with a GTP engine and an s
* You can now run the compiled `main` executable to do various things. Edit the configs to change parameters as desired.
* Example: `./main gtp -model <NEURALNET>.txt.gz -config configs/gtp_example.cfg` - Run a simple GTP engine using a given neural net and example provided config.
* Example: `./main evalsgf <SGF>.sgf -model <NEURALNET>.txt.gz -move-num <MOVENUM> -config configs/eval_sgf.cfg` - Have the bot analyze the specified move of the specified SGF.
* Neural nets from KataGo's run up to LZ130ish strength will be available soon on the releases page.
* Pre-trained neural nets are available on the [releases page](https://github.com/lightvector/KataGo/releases).

### Selfplay training:
If you'd also like to run the full self-play loop and train your own neural nets you must have [Python3](https://www.python.org/) and [Tensorflow](https://www.tensorflow.org/install/) installed. The version of Tensorflow known to work with the current code and with which KataGo's main run was trained is 1.12.0. Possibly later or earlier versions could work too, but they have not been tested. You'll also probably need a decent amount of GPU power.
Expand All @@ -50,7 +50,7 @@ You may need to play with learning rates, batch sizes, and the balance between t

Example instructions to start up these things (assuming you have appropriate machines set up), with some base directory $BASEDIR to hold the all the models and training data generated with a few hundred GB of disk space. The below commands assume you're running from the root of the repo and that you can run bash scripts.
* `cpp/main selfplay -output-dir $BASEDIR/selfplay -models-dir $BASEDIR/models -config-file cpp/configs/SELFPLAYCONFIG.cfg -inputs-version 4 >> log.txt 2>&1 & disown`
* Some example configs for different numbers of GPUs are: configs/selfplay{1,2,4,8a,8b,8c}.cfg. You may want to edit them depending on your specs - for example to change the sizes of various tables depending on how much memory you have, or to specify gpu indices if you're doing things like putting some mix of training, gatekeeper, and self-play on the same machines or GPUs instead of on separate ones. Note that the number of game threads in these configs is very large, probably far larger than the number of cores on your machine. This is intentional, as each thread only currently runs synchronously with respect to neural net queries, so a large number of parallel games is needed to take advantage of batching.
* Some example configs for different numbers of GPUs are: configs/selfplay{1,2,4,8a,8b,8c}.cfg. You may want to edit them depending on your specs - for example to change the sizes of various tables depending on how much memory you have, or to specify gpu indices if you're doing things like putting some mix of training, gatekeeper, and self-play on the same machines or GPUs instead of on separate ones. Note that the number of game threads in these configs is very large, probably far larger than the number of cores on your machine. This is intentional, as each thread only currently runs synchronously with respect to neural net queries, so a large number of parallel games is needed to take advantage of batching.
* Inputs version 4 is the version of input features KataGo currently uses, to be written down for training.
* `cd python; ./selfplay/shuffle_and_export_loop.sh $BASEDIR/ $SCRATCH_DIRECTORY $NUM_THREADS`
* This starts both the shuffler and exporter. The shuffler will use the scratch directory with the specified number of threads to shuffle in parallel. Make sure you have some disk space. You probably want as many threads as you have cores.
Expand Down

0 comments on commit 810fade

Please sign in to comment.