• Stars
    star
    274
  • Rank 150,274 (Top 3 %)
  • Language
    Python
  • Created about 7 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Minimalistic AlphaGoZero-like Engine

Nochi --- Minimalistic AlphaGoZero-like Engine

Nochi is a fork of the Michi minimalistic Computer Go engine that replaces Monte Carlo simulations with a Keras neural model. It is an attempt to reproduce the AlphaGo Zero work on a small scale.

It is by no means as polished as Michi, but might still be useful as an inspiration.

This is a truly "zero-knowledge" system like AlphaGo zero, but it's not entirely 1:1, I did some tweaks which I thought might help early convergence:

  • AlphaGo used 19 resnet layers for 19x19, so I used 7 layers.
  • The neural network is updated after every game, twice, on all positions plus 64 randomly sampled positions from entire history, this all done four times - on original position and various symmetry flips (but I was too lazy to implement 90\deg rotation).
  • Instead of supplying last 8 positions on input of the network, I feed just the last position plus two indicator matrices showing the location of the last and second-to-last move.
  • No symmetry pruning during tree search.
  • Value function is trained with cross-entropy rather than MSE.
  • No resign auto-threshold but it is important to play 25% games without resigning to escale local "optima".
  • 1/Temperature is 2 for first three moves.
  • It uses a different number of simulations per move.

It has been verified to be able to get near GNUGo level in ~2 weeks (8500 games, 6 threads + 1x Tesla M60) on 7x7. Not terribly great but it clearly does something.

Nochi is distributed under the MIT licence. Now go forth, hack and peruse!

Usage

First, decide on the board size and edit the N parameter at the script beginning. N=19 is the default but you may want to use e.g. N=7.

To start training,

python ./michi.py selfplay

which will autogenerate a run id and make periodical snapshot (the numbers should be multiplied by thread count to get true number of games played). To resume in any mode (e.g. even start gameio or gtp), add the id as a parameter:

python ./michi.py selfplay G171107T013304_000000150

To play, you can e.g. pass the gtp argument and start it in gogui, or let it play a bunch of games with GNUGo:

gogui-1.4.9/bin/gogui-twogtp -black 'python ./michi.py gtp G171107T013304_000000150' -white 'gnugo --mode=gtp --chinese-rules --capture-all-dead' -size 7 -komi 7.5 -verbose -auto -alternate -games 20 -sgffile x

Nochi also supports supervised training:

while true; do find GoGoD-2008-Winter-Database/ -name '*.sgf' | shuf; done | python ./michi.py replay_train

To mix value supervision with actual MCTS training signal for positional output, use smt. like:

while true; do find GoGoD-2008-Winter-Database/ -name '*.sgf' | shuf; done | python ./michi.py replay_traindist G171107T224743_R000030000

You can freely switch between selfplay, supervised and supervised+MCTS using snapshots, they are compatible.

More Repositories

1

docile

DocILE: Document Information Localization and Extraction Benchmark
Python
116
star
2

nvgpu

NVIDIA GPU tools - monitoring on CLI & web app with multiple agents
Python
82
star
3

keras-multi-gpu

Multi-GPU data-parallel training in Keras
Jupyter Notebook
76
star
4

OCkRE

Deep learning model for OCR of document fields
Python
36
star
5

mlprague18-nlp

NLP Tutorial Workshop at MLPrague 2018
Jupyter Notebook
22
star
6

nvprof-tools

Python tools for NVIDIA Profiler
Python
21
star
7

flying-rectangles

A repository with anonymized invoices
12
star
8

chart-updater

Update Helm charts as they appear in the Helm repository
Python
10
star
9

whitening

Image whitening (text foreground separation) via median filter
Python
10
star
10

elisctl

Command line interface for controlling ELIS
Python
10
star
11

rossum

Python API Client & a command line interface for controlling Rossum
Python
8
star
12

tutorial-imdb

Machine Learning Tutorial for the PyVo meetup
Python
7
star
13

rossum-sdk

Python
6
star
14

fuzzy-vendor-matching-webhook-python

Example Rossum webhook for vendor matching based on vendor name, address or VAT ID
Python
6
star
15

simple-vendor-matching-webhook-python

Example Rossum webhook extension with simple vendor matching
Python
4
star
16

elis-capture

React Native app for uploading documents to Elis
TypeScript
3
star
17

rir-api-email

Rossum Invoice Robot Email Gateway
Python
3
star
18

rossum-uipath-integration

Integration library for connecting Rossum ELIS to UiPath
3
star
19

embedded-demo

Demo of the Rossum Embedded mode
HTML
2
star
20

docker-rabbitmq

RabbitMQ with additional plugins
Dockerfile
2
star
21

check-sum-webhook-nodejs

Example Rossum connector extension with a simple check
JavaScript
2
star
22

pohoda-mserver-client

Python API for the POHODA accounting system mServers
Python
2
star
23

prd

CLI tool for versioning and updating your Rossum configurations
Python
2
star
24

docker-atlantis

Dockerfile
1
star
25

docker-fluentd

Dockerfile
1
star
26

university

Build something cool with Rossum.ai
JavaScript
1
star