You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-7Lines changed: 14 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,20 @@
1
1
# Go Neural Net Sandbox
2
2
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:
4
4
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).
6
18
* 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.
7
19
* 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++
8
20
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
16
28
* 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).
17
29
* 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.
18
30
* 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.
24
31
25
32
# Experimental Notes
26
33
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