Skip to content

Commit 82f445e

Browse files
committed
Update readme
1 parent 535280b commit 82f445e

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
# Go Neural Net Sandbox
22

3-
This repo is currently a sandbox for personal experimentation in neural net training in Go. I haven't put much work to make the training pipeline usable by others, since this is foremost a personal sandbox, but if you're interested, the rough summary is:
3+
This repo is currently a sandbox for personal experimentation in neural net training in Go. I've only put a little work into making this repo usable by others, since this is foremost a personal sandbox, but if you're interested, here's how to get started:
44

5-
* You must have HDF5 installed for C++ (https://support.hdfgroup.org/HDF5/release/obtainsrc.html), as well as Tensorflow installed for Python 3.
5+
* You must have [Python3](https://www.python.org/) and [Tensorflow](https://www.tensorflow.org/install/) installed.
6+
* Either download a pre-trained model (https://github.com/lightvector/GoNN/releases) or train one yourself (see below).
7+
* Do things with the trained model
8+
* Run a GTP engine using the model to make moves directly: `./play.py -model <MODELS_DIRECTORY>/model<EPOCH>`
9+
* Dump one of the raw weight matrices: `./visualize.py -model-file <MODELS_DIRECTORY>/model<EPOCH> -dump p2/w:0`
10+
* Directly run a model on a position from an sgf file: `./eval_sgf.py -model-file <MODELS_DIRECTORY>/model<EPOCH> -sgf SGFFILE -move TURNNUMBER`
11+
12+
See LICENSE for software license. License aside, informally, if do you successfully use any of the code or any wacky ideas about neural net structure explored in this repo in your own neural nets or to run any of your own experiments, I would to love hear about it and/or might also appreciate a casual acknowledgement where appropriate. Yay.
13+
14+
### Training a Model
15+
16+
If you'd like to train your own model and/or experiment with the architectures in this repo, here are the steps.
17+
* You must have HDF5 installed for C++ (https://support.hdfgroup.org/HDF5/release/obtainsrc.html).
618
* Training consists of converting .sgf files into training rows written in HDF5 format, then reading that HDF5 file in Python to train using numpy and h5py to feed them to Tensorflow.
719
* The utility that converts .sgf to .h5 is written in C++. Compile it using CMake and make in writedata, which expects you to have h5c++
820
available. (on windows you can also use the deprecated compile.sh):
@@ -16,11 +28,6 @@ This repo is currently a sandbox for personal experimentation in neural net trai
1628
* By default, it considers 1 million samples to be one epoch. If you want to see initial results more quickly you can pass `-fast-factor N` to divide this and a few other things by N, and `-validation-prop P` to only use P proportion of the validation set, but you will probably want to manually modify train.py (see `TRAINING PARAMETERS` section) as well as model.py (to try a much smaller neural net first).
1729
* Depending on how much training data you have and how long you're willing to train for, you probably want to edit the `knots` in train.py that determine the learning rate schedule.
1830
* If you getting errors due to running out of GPU memory, you probably want to also edit train.py to shrink the `batch_size` and/or the `validation_batch_size`.
19-
* Do things with the trained model
20-
* Run a GTP engine using the model to make moves directly: `./play.py -model <MODELS_DIRECTORY>/model<EPOCH>`
21-
* Dump one of the raw weight matrices: `./visualize.py -model-file <MODELS_DIRECTORY>/model<EPOCH> -dump p2/w:0`
22-
23-
See LICENSE for software license. License aside, informally, if do you successfully use any of the code or any wacky ideas about neural net structure explored in this repo in your own neural nets or to run any of your own experiments, I would to love hear about it and/or might also appreciate a casual acknowledgement where appropriate. Yay.
2431

2532
# Experimental Notes
2633
You can see the implementations of the relevant neural net structures in "model.py", although I may adapt and change them as time goes on.

0 commit comments

Comments
 (0)