Life In 19x19
http://lifein19x19.com/

The most convenient computer territory scoring rules
http://lifein19x19.com/viewtopic.php?f=45&t=16490
Page 1 of 1

Author:  iopq [ Thu Mar 07, 2019 6:16 am ]
Post subject:  The most convenient computer territory scoring rules

If I'm going to train a neural net to estimate territory scoring, which rule set would yield the most acceptable 6.5 komi games without being too complicated to implement? Ideally it should not require filling all dame prior to passing, as that would be annoying to human opponents.

Author:  lightvector [ Thu Mar 07, 2019 6:36 am ]
Post subject:  Re: The most convenient computer territory scoring rules

Are you also going to try to get "no points in seki" correct as in Japanese-style territory rules, as well as things like the following?

At the end of the game, (I think) black does NOT need to lose one point by defending if white has no ko threats, if the game ends here, black is alive and white's two stones are dead as it stands:
Click Here To Show Diagram Code
[go]$$Bc
$$ ------------------
$$ | X O O . . X O . .
$$ | . X X X X X O . .
$$ | X X O O O O O . .
$$ | O O O . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .[/go]


I have a formalization of Japanese rules that is rigorous enough to work for computer self-play and gets this and other details right. It's based around Bill Spight's japanese-style rules, although I found a few other logical corner cases and ambiguities that had to be worked out carefully when trying to actually write the computer implementation. I haven't posted it yet, since I haven't fully tested it for self-play though.

It does need dame filling, although optionally deferring of filling to a cleanup phase that occurs after passing is okay. You might not need a ruleset rigorous enough for self-play though if you only intend to do supervised training on human game results that have correct final scores recorded already.

Author:  Bill Spight [ Thu Mar 07, 2019 8:21 am ]
Post subject:  Re: The most convenient computer territory scoring rules

lightvector wrote:
At the end of the game, (I think) black does NOT need to lose one point by defending if white has no ko threats, if the game ends here, black is alive and white's two stones are dead as it stands:
Click Here To Show Diagram Code
[go]$$Bc
$$ ------------------
$$ | X O O . . X O .
$$ | . X X X X X O .
$$ | X X O O O O O .
$$ | O O O . . . . .
$$ | . . . . . . . .[/go]



Right. This is an approach ko. When Black is komaster it is worth 7 pts. to Black. (Komaster means never having to ignore a ko threat to win the ko fight.) When neither player has a ko threat, Black is komaster and here is how the play may go.

Click Here To Show Diagram Code
[go]$$Wc
$$ ------------------
$$ | B O O 3 6 X O .
$$ | 1 X X X X X O .
$$ | X X O O O O O .
$$ | O O O . . . . .
$$ | . . . . . . . .[/go]


:b2: pass, :b4: @ :bc:, :w5: pass

The result of the ko fight is 7 pts. to Black.

----

Note: When White is komaster this position is worth 0 pts. of territory on average. Each ko play gains 6 pts. on average, so the ko will normally be played in the medium endgame stage. When neither player is komaster the player to win the ko fight will have to ignore a ko threat and the ko will be played somewhat later in the game. With correct play it should be unusual for this ko to remain on the board at the end of the game, but it can happen, and the rules need to allow for that possibility.

Author:  iopq [ Thu Mar 07, 2019 8:30 am ]
Post subject:  Re: The most convenient computer territory scoring rules

Ideally it should also work in Japanese scoring computer tournaments out of the box without weird hacks

Although I doubt Japanese rules are actually implemented for those, since they are nonsensical

Author:  Bill Spight [ Thu Mar 07, 2019 8:33 am ]
Post subject:  Re: The most convenient computer territory scoring rules

iopq wrote:
Ideally it should also work in Japanese scoring computer tournaments out of the box without weird hacks

Although I doubt Japanese rules are actually implemented for those, since they are nonsensical


The Japanese rules are differently sensical. ;)

Author:  RobertJasiek [ Thu Mar 07, 2019 9:58 pm ]
Post subject:  Re: The most convenient computer territory scoring rules

Use my Simplified Japanese Rules:

http://home.snafu.de/jasiek/sj.html

Author:  iopq [ Fri Mar 08, 2019 1:30 am ]
Post subject:  Re: The most convenient computer territory scoring rules

RobertJasiek wrote:
Use my Simplified Japanese Rules:

http://home.snafu.de/jasiek/sj.html


Quote:
A player's string in the position at the end of the alternation is independently alive if the analysis has created a two-eye-formation of his on at least one of its intersections.


https://senseis.xmp.net/?TorazuSanmoku is worth 2 then, since otherwise it's alive after passing (white gets one of the stones in an alive two-eye formation)
So does that mean if the player agreed to go to analysis he can no longer go back and fix the situation since playing it out before analysis yields more points?

Also, can you easily just retrofit a rule that says "territory is surrounded only by independently alive stones" to simulate Japanese no territory in seki rule? Isn't that just as simple as the territory in seki rule?

Author:  RobertJasiek [ Fri Mar 08, 2019 3:45 pm ]
Post subject:  Re: The most convenient computer territory scoring rules

iopq wrote:


The rules say: "The analysis is a move-sequence continuing the alternation"

Therefore, you cannot make a general statement like this. First of all, the analysis allows the players' mistakes. Therefore, at least you have to make the assumption of perfect play by both players during the analysis. Furthermore, before you can make one statement for the outcome of a perfectly played analysis, you have to study two cases:

1) Games in which the analysis starts by Black.

2) Games in which the analysis starts by White.

Next, note that three-points-without-capturing involves possibility for ko fights. Therefore, perfect play depends on the rest of the board. Therefore, three-points-without-capturing is NOT a simple local position in which there would always be the same perfect play for a given starting player, and so for either starting player. Hence, under the Simplified Japanese Rules, you may not make the general statement that three-points-without-capturing (with a single black stone and 4 white stones) was worth 2 points.

Instead, the evaluation depends on how the players play the analysis.

Quote:
since otherwise it's alive


The Simplified Japanese Rules do not use the term "alive". They use the term "independently alive". To apply rules, do not alter them.

Quote:
if the player agreed


Agreement is something done by both players.

Quote:
to go to analysis he can no longer go back and fix the situation since playing it out before analysis yields more points?


The rules say: "The game consists of the alternation, then the optional analysis, and then the game end."

Therefore, a) there is exactly one alternation, at most one analysis and exactly one game end, b) the alternation precedes the analysis.

Quote:
Also, can you easily just retrofit a rule that says "territory is surrounded only by independently alive stones" to simulate Japanese no territory in seki rule? Isn't that just as simple as the territory in seki rule?


It is possible to make the rules less simplified, e.g., by adding a "seki" exception. See some of my other rulesets for how to do so.

Author:  Bill Spight [ Tue Nov 12, 2019 9:16 am ]
Post subject:  Re: The most convenient computer territory scoring rules

iopq wrote:
If I'm going to train a neural net to estimate territory scoring, which rule set would yield the most acceptable 6.5 komi games without being too complicated to implement? Ideally it should not require filling all dame prior to passing, as that would be annoying to human opponents.


May I suggest button go? (See https://senseis.xmp.net/?ButtonGo ). It uses area scoring where a player can make a move that takes a button worth ½ pt. Normally the score by button go is the territory score plus ½ pt. So using it with a 7 pt. komi would be like regular territory scoring with a 6½ pt. komi. Alternatively you could have a 6½ pt. komi where taking the button is worth 1 pt. to White but 0 to Black. Button Go has been implemented in international competition, without calling it that, by giving White 1 pt. for passing first. You can also implement button go by modifying the AGA rules with territory counting such that, instead of White being required to make the last pass, the player who is required to make the last pass is the opponent of the player who makes the first pass.

It is true that Button Go does not handle the question of zero territory in seki by both the modern Japanese and Korean rules, and it is unfamiliar to humans, although AGA players who do not like the rule that White always has to make the last pass may welcome it. But still, it may be adequate for training a program to estimate the territory score in general.

Author:  lightvector [ Tue Nov 12, 2019 11:39 am ]
Post subject:  Re: The most convenient computer territory scoring rules

I've finally started actual test runs of KataGo with support for Japanese-like rules. Results seem pretty promising so far. The set of supported rules will be any possible combination of the following:

{SimpleKo,PositionalSuperKo,SituationalSuperKo}
{AreaScoring, TerritoryScoring}
{AllTerritoryIsScored,NoTerritoryInSeki,NoTerritoryInSekiAnd2PointGroupTax}
{SuicideAllowed,SuicideNotAllowed}

Once I have more confirmation that things work over the next month, I'll post the full formal ruleset that is rigorous enough to work for self-play training. It is 'incentive-compatible' with Japanese rules in almost all common cases that I know of. But not all, one difference is that 3-points-without-capturing will actually be 3 points, rather than seki-unless-black-accepts-just-2-points, I'm also okay with there being rare rules beasts where the results will differ. It also does not always "require" that the players fill the dame before passing (but then again, most servers that implement territory scoring don't either, and in any case filling the dame normally won't hurt either).

I had not planned to implement button go, it did not seem to me that any button go ruleset was in common use (and unlike group tax, I hadn't received any specific requests to support it).

Do you think I should? I very much do not want to introduce it as a separate "move" which would greatly complicate architectures and be incompatible with things like GTP. So it seems preferable to introduce it as bonus for first "pass". But then, to get a rigorous self-play ruleset, it seems that careful engineering of ko ban lifting and game-end conditions for passes must then also take place, which I have not spent the time trying to work out. This is also why I haven't implemented it.

Author:  Bill Spight [ Tue Nov 12, 2019 12:10 pm ]
Post subject:  Re: The most convenient computer territory scoring rules

lightvector wrote:
I've finally started actual test runs of KataGo with support for Japanese-like rules. Results seem pretty promising so far. The set of supported rules will be any possible combination of the following:

{SimpleKo,PositionalSuperKo,SituationalSuperKo}
{AreaScoring, TerritoryScoring}
{AllTerritoryIsScored,NoTerritoryInSeki,NoTerritoryInSekiAnd2PointGroupTax}
{SuicideAllowed,SuicideNotAllowed}

Once I have more confirmation that things work over the next month, I'll post the full formal ruleset that is rigorous enough to work for self-play training. It is 'incentive-compatible' with Japanese rules in almost all common cases that I know of. But not all, one difference is that 3-points-without-capturing will actually be 3 points, rather than seki-unless-black-accepts-just-2-points, I'm also okay with there being rare rules beasts where the results will differ. It also does not always "require" that the players fill the dame before passing (but then again, most servers that implement territory scoring don't either, and in any case filling the dame normally won't hurt either).


This is great! :D

Quote:
I had not planned to implement button go, it did not seem to me that any button go ruleset was in common use (and unlike group tax, I hadn't received any specific requests to support it).

Do you think I should? I very much do not want to introduce it as a separate "move" which would greatly complicate architectures and be incompatible with things like GTP. So it seems preferable to introduce it as bonus for first "pass". But then, to get a rigorous self-play ruleset, it seems that careful engineering of ko ban lifting and game-end conditions for passes must then also take place, which I have not spent the time trying to work out. This is also why I haven't implemented it.


OC, I am partial to Button Go, since AFAIK Barry Phease and I were the first people to come up with the idea independently. Others have also done so, as well, and it seems to yield results similar to the pre-Ing Taiwan rules. As a hybrid of area and territory rules, yielding territory style scores while also allowing questions of life and death to be treated as area rules do, IMHO it is a good candidate for international competitions. I agree that taking the button should lift ko and superko bans, otherwise you get into problems with end of game rules. It is simple to implement button go as a modification of AGA rules. If you call taking the button a pass, then say that the first pass and only the first pass lifts the superko ban, and the opponent of the first passer must make the final pass. Also, the first pass does not count towards ending play. You can use a half point komi by saying that if White makes the first pass she does not hand over a pass stone for it.

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/