When I started to play Go in 2005, everyone was laughing at computers playing the game. There was a 1 kyu player who crushed The Many Faces of Go (which was the strongest Go playing software at that time) with 33 handicap stones! If you don’t believe me, here’s that game. These days we learn from machines. If you have plans of learning Go more seriously, you just can’t do without computer analysis.
However I would recommend starting to use AI only when you reach 10 kyu. Alexander Dinerstein 3p even insists on setting this margin higher at 5 kyu. The reason being that AI suggests very strong moves without explaining their meaning. If you follow these suggestions blindly without trying to understand what is hidden behind them, it will not do you any good.
KataGo and Leela Zero — Which Engine to Choose?
At this point KataGo is considered to be stronger than Leela Zero. Besides KataGo can estimate move value not only in win/loss probabilities but also in points of territory. That’s why more and more players have been using KataGo as of late.
Reviewing Software and Services for Game Analysis
You can use both engines on any computer, but if you have a “toaster” that’s a decade old and can hardly run the classic Heroes of Might and Magic games, it’s still not the time to worry. There are several online services that you can use:
All of them are made well with some usage restrictions in free mode and they lack a little in stability. Out of these three I personally prefer using zBaduk, besides the subscription for it is really not expensive (€4 a month). Also Go Magic members can Get 30 days premium access to ZBaduk.
Game analysis feature is also built into some Go servers. For example, OGS will analyze all of your games with a monthly “donation” of at least $3. That’s convenient.
However if you have a modern computer with a good graphics card, you can manage without any paid services. In order to analyze your games you’ll need software with a graphical user interface (GUI) for one of the engines. Here are some of the options:
KaTrain — the easiest option if you don’t want to go deep into the details of installation and settings. It supports many interesting functions and features that are unique to KaTrain. On the downside it only supports KataGo engine.
Lizzie — probably the most popular GUI of its kind. It supports both Leela Zero and KataGo.
Sabaki — a modern game editor and GUI that lets you connect any AI to it.
LizGoban — an alternative GUI for Leela Zero and KataGo.
q5Go — another game editor that supports AI analysis.
While I was writing this article I found this BadukMegapack in the depths of GitHub, that allows you to download and install all of the available engines and GUIs (Windows only). I haven’t tested it myself but maybe somebody would like to try it.
In this article we’ll go into detail of installing KaTrain and Lizzie.
Downloading Software from GitHub
Let’s use Lizzie as an example.
No doubt you’ve noticed that all of those links above are from github.com. If you are not a programmer then you are probably wondering how you can download anything from there. Why so complicated? Originally GitHub was used only among developers to work on projects together, but these days it’s become a popular platform that is also used for software distribution. Rather than create a website for their software a programmer can just make a repository on GitHub.
In order to download something here we need to go to releases:
If you can’t see that link for some reason then read the description carefully (README.md).
Also notice the “Issues” tab. Here you can report any problems or bugs that you find.
I highly recommend you to use this section. Don’t expect issues and bugs to miraculously disappear — help developers find them.
Installing and Configuring
You shouldn’t run into any trouble with this software. First off let’s download the latest version here (assets → KaTrain.exe).
For Windows users this is a regular .exe file, that you can transfer anywhere, even on your desktop if you wish. Double-click the file and ta-da — you can start using it. KaTrain keeps all of the settings and additional files in the system folder.
Be sure to take a look into the settings (F8):
Here you can download and install the latest neural network version (they get updated often these days) — “Download Models” button. For a deeper game analysis I also recommend you to increase the values of the following parameters:
- Maximum number of visits
- Maximum time for analysis
- Wide root noise
This last parameter is responsible for the number of variations suggested by KaTrain, I think this is the most interesting part.
Note that KaTrain (unlike Lizzie) doesn’t analyze a position indefinitely but does it in iterations in accordance with the limits in the settings (Maximum visits, Maximum time). In order to make it analyze a position deeper, you need to click on “Deeper Analysis” or “A” on the keyboard.
KataGo’s developers have recently made neural network training open so everyone can contribute to it now. This function is also available in KaTrain. You can read the details on katagotraining.org
Generally speaking KaTrain is very easy to use, everything should be self-explanatory there. Personally however I’m more used to Lizzie’s interface. Even though it’s slightly less user-friendly and more difficult to configure, you might like it better as well.
Installing and Launching
- Go to releases and download the latest program version for your OS. If you are using Windows, you’ll need the archive marked GPU (Lizzie.???.Windows.x64.GPU.zip).
- Unpack the archive into any folder.
- This step is optional. I recommend you to install the improved and complemented build of Lizzie. The thing is that the original software is rarely updated, so a developer nicknamed hope366 made his own build. Download the latest release (Lizzie-improved-v???.zip) and unpack the archive into folder with the original lizzie program. Then delete the file “lizzie.jar” and rename “lizzie-improved-v???.jar” into “lizzie.jar”.
- Start the file “lizzie.jar”.
The first launch usually takes a long time because your graphic card needs to get configured.
If the program doesn’t start, that’s probably because you haven’t installed Java. Just like KGS (CGoban), Lizzie runs on Java. The developer’s requirements say that you need at least Java 8.
How to Reset Lizzie to English
In Lizzie 0.7.4 there is no way of changing the language for some reason. If your operating system is in a language other than English, then Lizzie is likely to start automatically in that language. That might seem perfect, but there might be translation mistakes and glitches in those other versions. That’s why I prefer the English version.
Download lizzie-en.bat and put it in your program folder. Just run this file and Lizzie will speak English again.
The solution to this problem is explained here.
How to Update the Neural Network
The engine itself (Leela Zero or KataGo) is updated very rarely but networks are regularly trained and updated. On top of that there are different kinds of neural networks. Lizzie has 20-block networks preinstalled, but there are 40-block networks that are much more powerful. You can also install the network from ELF OpenGo (Facebook) or SAI. You can try all sorts of experiments with neural networks, switch to different engines and configurations on the fly in order to review a game position extensively.
Note: networks are sometimes referred to as weights.
A neural network is connected to the engine with a separate file. You will find two files in the folder with Lizzie:
- katanetwork.gz — KataGo network
- lznetwork.gz — LeelaZero network
These are the files that should be replaced.
You will find networks for Leela Zero here. In order to download the latest valid network, click on hash:
Direct link to the strongest LeelaZero network.
After that you need to replace the file “lznetwork.gz” (in the program folder) with the one you just downloaded. It’s important to keep the same file name — “lznetwork.gz”.
Update. In February 2021 the developer of LeelaZero announced project closure since he thought the program reached its maximum strength. LeelaZero has now been replaced by a new project — SAI.
Networks for KataGo can be found here. The process is the same — download the strongest network and replace the file “katanetwork.gz” with it.
How to Update the Engine
The LeelaZero engine hasn’t been updated since 2019, but there are regular updates for KataGo. At the time of writing this article the latest version of Lizzie 0.7.4 came with KataGo 1.6.1 while version 1.8.1 was already available.
You will find the engine itself in releases. You will need the archive with “gpu-opencl”. Download the archive, then delete everything from your lizzie/katago folder and copy everything from the archive in there. That’s it, you can start using it now.
Don’t Let Your Computer Get Lazy
When using AI I ran into a problem that some of you might experience as well. The laptop that I’m using has two graphics cards — a discrete NVIDIA card and one built into CPU. For energy saving purposes the laptop utilizes the discrete card only when necessary (when playing video games for example) — that is called the hybrid graphics mode. Unfortunately analyzing games with KaTrain is not considered to be the case for turning on the discrete graphics card… 🙂
Checking whether your graphics card is working or not is quite easy — open the task manager (Ctrl+Shift+Esc), go to the “performance” tab. When running this software your graphics card should be working with 100% capacity. If it doesn’t, games will be analyzed very slowly. I solved this problem by turning off the hybrid mode — this can be done in BIOS or using a native laptop configuring software.
In the next few articles we’ll take a look inside the engine, see how we can fine-tune it and talk about the best ways of using AI to review your games.