Git Product home page Git Product logo

Comments (20)

alreadydone avatar alreadydone commented on July 30, 2024 5

In a QQ group, N.O.V.A. proposed that group tax could be implemented as an alternative rule in the KataGo engine/NN. This rule is in the "original" rule of Go and was in use in China even during the Qing dynasty before the back-influence from Japan (Dohei Takabe, 1909, reference). The idea is that only stones on the board count towards the player's score). Since a group needs to eyes to live which can't be filled, if a group of yours is split into two you effectively loses two points. This rule likely contributed to the combative style in ancient Chinese Go, and likely reduces the favorability of 3-3 invasions.

It would be a great addition to your engine: no AI to this date, even the polymath Golaxy, claims to support analysis under this rule, though it's pretty in demand to analyze ancient games and determine the level of play. An inconvenience is that one now needs to fill in all except two points in each of one's area to get the accurate score (with normal Tromp-Taylor rules you just need to remove the opponent's dead stones), especially in your setting, where all games are not resigned, but since you already have Benson's algorithm implemented to determine live groups and remove dead stones, it shouldn't take much more time to train under this rule. Hope to see this in a future run!

from katago.

poptangtwe avatar poptangtwe commented on July 30, 2024 4

I'm N.O.V.A. in the QQ group for Leela (Zero). Thanks for introducing the Group Tax, one of the simplified prejudgment scoring methods for the original rule of Go in Ancient China, in English.@alreadydone
To make a long story short, the original rule of Go only count stones alive in the end of games. Group Tax are equivalent to the original rule, and it's a simplification scoring method used during the Ming and Qing dynasty. Each group alive should remain two eyes, these eyes are not scored.
There are two benefits to implement this rule in KataGo.
The one @alreadydone mentioned is that no NN AI engine nowadays supports the rule, but Chinese amateurs are dying to analysis Chinese ancient games. And the rule are still used by some Chinese amateurs in matches.
The other one is that the original rule of Go is simpler, more convenient and more elegant mathamatically compared with the current Chinese rule. With Group Tax, the Tromp-Taylor scoring rules can be also simplified, since the score is just counting stones remain on the board in the end of games.
Thanks a lot. @lightvector

from katago.

alreadydone avatar alreadydone commented on July 30, 2024 2

Re: simplicity
Arguably no-pass Go (the first player without legal moves loses) has the simplest rule, but it's a very different game than the Go we play today. The next simplest rule is probably Tromp-Taylor with group tax, or more correctly, TT rules without counting empty points that only reach one player's color. Miraculously, this rule is mostly equivalent to no-pass Go with prisoner return which is also super simple mathematically and fits combinatorial game theory naturally.

By the way, @hzyhhzy has trained nets to play no-pass Go (without prisoner return) (7x7 IIRC) with modified LZ engine. (Edit: what he trained was acutally first-capture Go, another simple variant with very different play (likely simpler in this case).)

from katago.

Marcin1960 avatar Marcin1960 commented on July 30, 2024 1

Just do not let be persuaded to move to a huge net like 40 blocks or more. It would kill your project.

from katago.

lightvector avatar lightvector commented on July 30, 2024 1

Hi @alreadydone - thanks. Yes, I'm aware that he was a researcher at DeepMind, that was presumably why he was one of the individuals able to clarify things ambiguous in the publication.

Yes, a square root is missing there, I will correct that shortly along with a few other minor errors and typos that have been discovered. Thanks for pointing it out!

I have not done a detailed investigation of komi on even boards, but once you get the code working, you're very welcome to investigate! :)

It would be hard to extend my code to handle disjoint unions of boards, but rectangular boards would be straightforward, I might do that in a future run. Almost all of the code is theoretically written to support rectangular size, just some of the highest-level parts are not, in part because for some strange reason neither GTP nor SGF files have any support for it?

from katago.

bernds avatar bernds commented on July 30, 2024 1

You need to adjust this in src/config.h

/*
 * BOARD_SIZE: Define size of the board to compile Leela with, must be an odd
   number due to winograd tiles
 */
static constexpr auto BOARD_SIZE = 19;

from katago.

lightvector avatar lightvector commented on July 30, 2024

I could run a test versus 13x13. Do you need to do something special when compiling for LZ to play on 13x13, or does it work out of the box if you just give it the adjusted network?

from katago.

alreadydone avatar alreadydone commented on July 30, 2024

Though unlikely to happen in real play, there actually exist positions, under the situational/positional superko rules, in which one side must fill in all (but one) of the eyes in a pass-alive group (to be captured by the opponent) in order to win. An example is presented in https://tieba.baidu.com/p/1287975900.

from katago.

lightvector avatar lightvector commented on July 30, 2024

Yep. You can make much simpler positions too that have this property, see https://senseis.xmp.net/?1EyeFlaw. (variations on 1 eye flaw are easy ways to construct these). The training I implemented I believe makes no assumptions about this, although probably the neural net wouldn't get it right anyways given that they already fail on much simpler things.

But it is always safe to assume that your pass-alive groups and their single-eye-points - and, if the rules let you claim opponent stones that are pass-dead as pass-dead without physically capturing them during normal play, also your pass-alive territories that are larger than single eyes - together give a lower bound on your score under optimal play, even if you might choose to sacrifice them to do better.

You can also construct rules beast positions where it's not possible or not desirable to capture stones that are pass-dead and remove them from the board due to superko considerations, so even though they are surrounded by pass alive groups and themselves being pass-dead can never even possibly become "alive". Under Tromp-Taylor, you would then have to leave them uncaptured, unable to claim the points for killing them, which maybe could prevent you from winning. I've mostly chosen to ignore this issue, since it's not as if Tromp-Taylor is a standard ruleset that human games use in practice either. I imagine if such a situation occurred in a real and/or important game, the rules argumentation would be very interesting.

from katago.

lightvector avatar lightvector commented on July 30, 2024

@alreadydone
LZ converted weights work quite well. On 13x13, it's about 140 Elo stronger than KataGo when both have 1600 visits, with a winloss record of 563 - 255 in the test match I did.

The converted weights are still 40 block and 256 channels, right? If I multiply KataGo visits by 4 up to 6400, still using 15 blocks 192 channels, then it looks like a pretty even matchup. In that case, they're almost equal in strength based on the test run I did. KataGo winning 309-291.

from katago.

alreadydone avatar alreadydone commented on July 30, 2024

@lightvector Thanks for doing the tests! Congrats for KataGo winning the time-parity test despite being trained with much less resource!

from katago.

lightvector avatar lightvector commented on July 30, 2024

Games attached, in case anyone's curious.
lz-v-kata13x13-1600.txt
lz-v-kata13x13-1600-4800.txt

from katago.

bernds avatar bernds commented on July 30, 2024

These contain invalid moves in the SGF: if LZ fills its own territory as Black, there are W[tt] nodes from KataGo.

from katago.

lightvector avatar lightvector commented on July 30, 2024

Why are W[tt] nodes invalid? I agree this is a pretty ugly way to indicate a pass compared to W[], but they're part of the SGF specification and this notation does seem to be the one that gomill library produces by default, which is the GTP controller library I downloaded to run the matches.

from katago.

bernds avatar bernds commented on July 30, 2024

I looked at it again, and it seems [tt] is an FF[3] thing, retained for compatibility in FF[4]. I just hadn't encountered this before and thus q5go currently doesn't handle it well.
I still think it would be better not to do this - what happens on larger boards, does it use the [] syntax?

from katago.

lightvector avatar lightvector commented on July 30, 2024

I don't know. I didn't write Gomill! :)

Maybe talk to the author of the library? Looks like there's a contact address at the bottom of this page: https://mjw.woodcraft.me.uk/gomill/ and also a Github here https://github.com/mattheww/gomill/

from katago.

lightvector avatar lightvector commented on July 30, 2024

You'll probably encounter this elsewhere too, I'm surprised you haven't yet. Some of the tests for LZ or MiniGo I think I've heard people using "ringmaster" in some cases, which is also a script from the Gomill library.

from katago.

lightvector avatar lightvector commented on July 30, 2024

Going ahead and closing this issue, as it seems everything here is handled. Wheee. :)

edit: (And it is on my long-term todo list to investigate group-tax rules, but it's not quite as urgent as a lot of other things, so it might be some time)

from katago.

TFiFiE avatar TFiFiE commented on July 30, 2024

The paper is (still) missing footnote 33, which I suspect would have covered what combination of z and Q to train the value prediction on (like what's in LeelaChessZero/lc0#84 (comment)).

from katago.

lightvector avatar lightvector commented on July 30, 2024

Thanks for pointing that out. There is no missing footnote at all, it's just a numbering issue. I'm not using Q at all either, I would absolutely have mentioned that as a section in the paper if I did since that would be a big difference from any other prior bot (AZ, ELF, LZ, etc).

from katago.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.