Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LZ that does not escape difficult ladder is slightly(54%) stronger #2502

Open
yssaya opened this issue Sep 20, 2019 · 7 comments
Open

LZ that does not escape difficult ladder is slightly(54%) stronger #2502

yssaya opened this issue Sep 20, 2019 · 7 comments

Comments

@yssaya
Copy link

yssaya commented Sep 20, 2019

If ladder search find its dead over 7 plies, escaping move probability is changed to 1/1000000.

"not escape difficult ladder" winrate is 0.541 (433 wins / 800 games) against normal LZ 0.17.

Source is here. (forked from latest LZ)
https://github.com/yssaya/leela-zero-ladder
I use Henrik Forsten(Ttl) ladder code.
https://github.com/Ttl/leela-zero/tree/liberty_planes_se2

For example, in left figure, ladder search needs 42 plies to understand Black E7 is killed.
So Black E7 probablity is changed from 0.55895 to 0.00000055895.
In right figure, ladder search needs 6 plies. So program does nothing and LZ plays escape move Black N17.

   a b c d e f g h j k l m n o p q r s t        a b c d e f g h j k l m n o p q r s t
19 . . . . . . . . . . . . . . . . . . . 19  19 . . . . . . . . . . . . . . . . . . . 19
18 . . . . . . . . . . . . . O . . . . . 18  18 . . . . . . . . . . . . . O . . . . . 18
17 . . . . . . . . . . . . . X O O O . . 17  17 . . . . . . . . . . . . . X O O O . . 17
16 . . . X . . . . . + . . . . X X X . . 16  16 . . . X . . . . . + . O X(O)X X X . . 16
15 . . . . . . . . . . . . . . . . . . . 15  15 . . . . . . . . . . O X X O . . . . . 15
14 . . . . . . . . . . . . . . . . . . . 14  14 . . . . . . . . . O X X O . . . . . . 14
13 . . . . . . . . . . . . . . . . . . . 13  13 . . . . . . . . O X X O . . . . . . . 13
12 . . . . . . . . . . . . . . . . . . . 12  12 . . . . . . . O X X O . . . . . . . . 12
11 . . . . . . . . . . . . . . . . . . . 11  11 . . . . . . O X X O . . . . . . . . . 11
10 . . . + . . . . . + . . . . . + . . . 10  10 . . . + . O X X O + . . . . . + . . . 10
 9 . . . . . . . . . . . . . . . . . . .  9   9 . . . . O X X O . . . . . . . . . . .  9
 8 . . .(O). . . . . . . . . . . . . . .  8   8 . . . O X X O . . . . . . . . . . . .  8
 7 . . O X . . . . . . . . . . . . . . .  7   7 . . O X X O . . . . . . . . . . . . .  7
 6 . . X O O . . . . . . . . . . . . . .  6   6 . . X O O . . . . . . . . . . . . . .  6
 5 . . X . . . . . . . . . . . . . . . .  5   5 . . X . . . . . . . . . . . . . . . .  5
 4 . . X O . . . . . + . . . . . O . . .  4   4 . . X O . . . . . + . . . . . O . . .  4
 3 . . . . . X . . . . . . . . . . . . .  3   3 . . . . . X . . . . . . . . . . . . .  3
 2 . . . . . . . . . . . . . . . . . . .  2   2 . . . . . . . . . . . . . . . . . . .  2
 1 . . . . . . . . . . . . . . . . . . .  1   1 . . . . . . . . . . . . . . . . . . .  1
   a b c d e f g h j k l m n o p q r s t        a b c d e f g h j k l m n o p q r s t

http://www.yss-aya.com/cgos/viewer.cgi?19x19/SGF/2019/09/11/599617.sgf

Ignoring short depth is effective when killing eye.

4 . . O + X X X .
3 . X O O O X . .
2 . O X . . . . .    White A2 is killed by 2 plies search, but needed to kill eye.
1 .(X). . . . . .
  a b c d e f g h

I only tested 400 visit/move. It might be even or weak on longer game or time patiry.

Test match is 800 games. First 10 moves are from opening book, pro(gogod) games.
Symmetry position are deleted. Black and white is alternate per a opening. Weight is LZ 244.

Test command is like this.
$ java -jar ~/go/gogui/bin/gogui-twogtp.jar -black "~/go/ladder/build/leelaz17 -v 400 -r5 -g -q -d --noponder -w ~/go/leela-zero-0.15/autogtp/networks/2baef15960bf40ebf613f5b0b738d41b89646332403d105e11f8623d54cce792" -white "~/go/ladder/build/leelaz -v 400 -r5 -g -q -d --noponder -w ~/go/leela-zero-0.15/autogtp/networks/2baef15960bf40ebf613f5b0b738d41b89646332403d105e11f8623d54cce792" -games 2000 -size 19 -alternate -sgffile memo -auto -komi 7.5 -openings "~/go/ladder/opening/19x19_gogod_2014_1000"

@l1t1
Copy link

l1t1 commented Sep 21, 2019

nice found

@yssaya
Copy link
Author

yssaya commented Oct 10, 2019

As a result of increasing the number of games a little more, winrate was 0.529. (800 visit/move, 2000 games)
Here is leelaz.exe for Windows.
https://github.com/yssaya/leela-zero-ladder/releases/tag/v0.17_ladder
This will work if you replace leelaz.exe with a normal one.

I also tested "allow escaping when ko" and "Do not chase 'not ladder'".
But both are not significantly stronger.

Result against normal LZ. weight is 244. 800 visit/move. using opening book for first 10 moves.

"Do not escape difficult ladder"  1058 wins  942 losses (2000games) winrate 0.529
"allow escaping when ko"           998 wins 1002 losses (2000games) winrate 0.499
"Do not chase 'not ladder'"       1024 wins  976 losses (2000games) winrate 0.512

A sample of "Do not chase 'not ladder'".
http://www.yss-aya.com/cgos/viewer.cgi?19x19/SGF/2019/10/08/609399.sgf&110

Test command is like this.
$ java -jar ~/gogui/gogui-twogtp.jar -black "~/go/ladder/leelaz17 -v800 -r5 -g -q -d --noponder -w ~/go/networks/244_2bae" -white "~/go/ladder/leelaz -v800 -r5 -g -q -d --noponder -w ~/go/networks/244_2bae" -games 2000 -size 19 -alternate -sgffile memo -auto -komi 7.5 -openings "~/go/ladder/opening/19x19_gogod_2014_1000"

Average searching speed of 10 positions is as follows. (a 2080 Ti, 10000 playouts)

932 n/s  ... Normal
944 n/s  ... "Do not escape difficult ladder"

"Do not escape difficult ladder" is slightly faster. But it should be measurement error.
There may be almost no decrease in speed.

@l1t1
Copy link

l1t1 commented Oct 11, 2019

testing validation -k 768 -n \768.txt -o "-g -v 100 -r 5 -w" -n \768.txt -o "-g -v 100 -r 5 -w" -- leelaz_lad.exe leelaz.exe

94 wins, 82 losses
176 games played.
Status: 0 LLR 0.314042 Lower Bound -2.94444 Upper Bound 2.94444

@yssaya
Copy link
Author

yssaya commented Oct 23, 2019

I have tested against KataGo.

Result against KataGo 1.2 g104-b20c256. LZ weight is 247. Both players use 800 visit/move. First 10 moves are from opening book.

"Normal Leela Zero"               978 wins 1022 losses (2000games) winrate 0.489, ELO=  -7.6
"Do not chase 'not ladder'"      1042 wins  958 losses (2000games) winrate 0.521, ELO= +14.6

"Do not chase 'not ladder'" is +22.2 ELO stronger than normal LZ.
LZ often lost to KataGo by "chasing not ladder", so I thought this option would work.
But it wasn't.

@nemja
Copy link

nemja commented Oct 23, 2019

I don't think adding ladder code without retraining the net is anything close to what other bots have.

@wonderingabout
Copy link
Contributor

i suggest you try with --batchsize 1 -t 2
as Naphtalin showed on discord, these settings have much stronger ladder performance

@portkata
Copy link

portkata commented Mar 8, 2020

Can you add alreadydone's "dynamic komi" code to your engine so we can play with 0 komi? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants