kaorahi / lizgoban

Leela Zero & KataGo visualizer
GNU General Public License v3.0
169 stars 28 forks source link
baduk igo sgf weiqi

LizGoban - Leela Zero & KataGo visualizer

LizGoban is an analysis tool of the game Go with Leela Zero and KataGo. It is an implementation of Lizzie-style real-time UI on Electron with lots of original gimmicks.

(Facial stone images from Goisisan)

Table of contents

Highlights

  1. AI does not tell the reason of suggestions. So LizGoban aims at a GUI for easy trial of what-if in addition to quick browse of proposed variations. For example, you can use any number of trial boards in parallel, discard a needless one by a single action, and restore the deleted one if necessary.
  2. AI's suggestions are not 100% reliable, of course. We hope to get some signs when the suggested moves are unreliable. LizGoban visualizes convergence and consistency of estimations for this purpose. We can notice the case when we should wait for a little more analysis, and will never miss a new rising candidate like the one in the above screenshot.
  3. AI can make game watching boring if we only focus on win rate. LizGoban provides hints to help us understand the game's development from multiple perspectives. For example, who invested in more thickness? When it was cashed to territories?

You will enjoy LizGoban if you are interested in the process as well as the result of the search by AI. You may also like experiments of various new ideas on Go GUI, e.g. quick ladder check, random generation of various playing styles, etc. If you just expect ordinary features and beautiful graphics, probably you will prefer other GUIs.

Features

Common features

Original features

Original visualizations

Setup

64bit Windows

Just download the all-in-one package. You can enjoy KataGo immediately without installation, configuration, additional downloads, etc.

Other platforms (Mac, Linux, ...) or Windows with more flexible configuration

To use LizGoban with Leela Zero:

  1. Install Node.js v12 or later.
  2. Type git clone https://github.com/kaorahi/lizgoban; cd lizgoban; npm install on a terminal.
  3. Put Leela Zero binary (version 0.17 or later) as external/leelaz together with its network weight as external/network.gz.
  4. Type npm start. (Windows: Double-click lizgoban_windows.vbs or lizgoban_windows.ps1.)

Use npm start -- --no-sandbox if you get an error like "The SUID sandbox helper binary was found, but is not configured correctly" and you do not want to fix it.

To use LizGoban with KataGo:

Follow the above 1 and 2. Place KataGo binary, its model, and its GTP configuration somewhere, say /FOO/BAR/katago, /FOO/BAR/model.bin.gz, and /FOO/BAR/gtp.conf. Then write config.json as follows.

{
    "preset": [
        {
            "label": "KataGo",
            "engine": ["/FOO/BAR/katago", "gtp",
                       "-override-config", "analysisPVLen=50, defaultBoardSize=19",
                       "-model", "/FOO/BAR/model.bin.gz",
                       "-config", "/FOO/BAR/gtp.cfg"]
        }
    ]
}

Start LizGoban as

npm start -- -c config.json

(Windows: Put the above config.json into the same folder as lizgoban_windows.vbs and double-click lizgoban_windows.vbs.)

Never set reportAnalysisWinratesAs and ponderingEnabled in your *.cfg.

For the human-style features from KataGo v1.15.0, review the sample config.json in the Windows package.

To configure LizGoban:

Here is a longer example of config.json for Leela Zero 0.17 and KataGo 1.4.4 or later.

{
    "analyze_interval_centisec": 20,
    "autosave_deleted_boards": 5,
    "autosave_sec": 300,
    "sgf_dir": "/FOO/BAR/sgf/",
    "exercise_dir": "/FOO/BAR/exercise/",
    "max_cached_engines": 3,
    "preset": [
        {
            "label": "Leela Zero",
            "accelerator": "F1",
            "engine": ["/FOO/BAR/leelaz", "-g", "-w", "/FOO/LZ_NET/254.gz"]
        },
        {
            "label": "KataGo",
            "accelerator": "F2",
            "engine": ["/FOO/BAR/katago", "gtp",
                       "-override-config", "analysisPVLen=50, defaultBoardSize=19",
                       "-model", "/FOO/KATA_NET/g104-b20c256.gz",
                       "-config", "/FOO/BAR/gtp.cfg"]
        },
        {
            "label": "LZ",
            "label_for_white": "KATA",
            "empty_board": true,
            "engine": ["/FOO/BAR/leelaz", "-g", "-w", "/FOO/LZ_NET/254.gz"],
            "engine_for_white": ["/FOO/BAR/katago", "gtp",
                       "-model", "/FOO/KATA_NET/g104-b20c256.gz",
                       "-config", "/FOO/BAR/gtp.cfg"]
        },
        {"label": "Hide hints", "accelerator": "F3", "board_type": "raw"},
        {"label": "Show hints", "accelerator": "F4", "board_type": "double_boards"}
    ]
}

(1) In these items, you can use relative paths from the "working directory", that is the folder of `LizGoban.exeitself in the all-in-one package orexternal/otherwise. For example, you can simply write "leelaz" forexternal/leelaz`.

It is recommended to put all Leela Zero weights into one directory and all KataGo weights into another directory for using [Load network weights] menu conveniently. Delete obsolete "weight_dir" in your config.json if you wrote it.

Notes on KataGo: After KataGo 1.3.4, you can add defaultBoardSize=19 as the above example to shorten the initialization of 9x9 and 13x13. ("=19" is ok. It is replaced with 9 or 13 inside LizGoban automatically.)

For quick experiments, you can also use

npm start -- -j '{"sgf_dir": "/foo/bar/baz/"}'
npm start -- -c config.json -j '{"sgf_dir": "/foo/bar/baz/"}'
etc.

on Mac or Linux. The latter option overwrites the former one in the second example.

In addition, LizGoban reads external/config.json (and config.json in the "working directory" in the above (*1)) beforehand if they exist.

To play stone sounds:

Prepare the sound files by yourself and place them in the external/ directory. Then add the entry "sound_file" to config.json as shown below. In this setup, one of the three sound files will be played randomly for each move.

{
    ...
    "sound_file": {
        "stone": ["stone1.wav", "stone2.wav", "stone3.wav"],
        "capture": ["capture.wav"],
        "pass": ["pass.wav"]
    },
    ...
}

To show ownerships of stones by facial expressions:

Prepare stone images and put them into external/ directory. For example, images in Goisisan are used in the above screenshot.

Then add "face_image_rule" and "face_image_diff_rule" into config.json like this.

{
    ...
    "face_image_rule": [
        [-0.8, "goisi_k4.png", "goisi_s4.png"],
        [-0.4, "goisi_k8.png", "goisi_s8.png"],
        [0.00, "goisi_k7.png", "goisi_s7.png"],
        [0.30, "goisi_k11.png", "goisi_s11.png"],
        [0.90, "goisi_k10.png", "goisi_s10.png"],
        [1.00, "goisi_k16.png", "goisi_s16.png"]
    ],
    "face_image_diff_rule": [
        [-1.0, "goisi_k15.png", "goisi_s15.png"],
        [-0.5, "goisi_k9.png", "goisi_s9.png"],
        [0.50, null, null],
        [1.00, "goisi_k5.png", "goisi_s5.png"],
        [2.00, "goisi_k14.png", "goisi_s14.png"]
    ],
    ...
}

The former is applied only if the latter says null. Namely, when "ownership" = O and "change of ownership" = C,

Set KataGo as the engine and select View > Stone > Face. You need to enable View > Ownership if you have disabled it.

To use TamaGo 0.9.0 or later

Set "board_size" and "wait_for_startup" in config.json as follows.

{
    ...,
    "preset": [
        ...,
        {
            "label": "TamaGo",
            "engine": ["/bin/python3", "/PATH/TO/main.py", "--model", "/PATH/TO/model.bin"],
            "board_size": 9,
            "komi": 7,
            "wait_for_startup": false
        },
        ...
    ]
}

To replace images of board and stones (Experimental)

Put your favorite images of board and stones as external/board.png, external/black.png, and external/white.png (before starting LizGoban).

To control LizGoban from another program (Experimental)

ref.

You can control lizgoban from its STDIN as follows (example on Linux).

$ cd lizgoban/
$ echo 'mimic("play", "D3"); mimic("play", "R4")' | npm start -- -j '{"repl": true}'

See const api = ... in src/main.js for the list of commands. "Debug log" in "Debug" menu will be also useful if you want to observe which API is called for each mouse/keyboard operation. For debugging, you may prefer to type mimic(...) directly on the console with "REPL" in "Debug" menu.

Please note that this feature is experimental and API etc. may be changed in future.

Usage

For information about the displayed marks, shortcut keys, and other features, refer to the "Help" menu in the app.

Major changes

0.8.*

Incompatibilities:

0.7.*

Incompatibilities:

0.6.*

Incompatibilities:

0.5.*

Incompatibilities:

0.4.0

Incompatibilities:

0.3.*

0.2.0

0.1.0

Links

Project Home / License (GPL3)