https://github.com/zakki/cgos/tree/genmove_analyze
https://twitter.com/k_matsuzaki/status/ ... 2745724932
Python version of CGOS by Zakki
-
- Posts: 219
- Joined: Tue Feb 12, 2008 8:31 pm
- Contact:
Re: Python version of CGOS by Zakki
Now I'm trying lz-genmove_analyze and lizzie style extension at CGOS server.
https://github.com/zakki/cgos/tree/genmove_analyze
https://twitter.com/k_matsuzaki/status/ ... 1746693120
If engine supports "kata-genmove_analyze" or "lz-genmove_analyze", clinet-python sends pv and winrates to server.
I think we need to define a subset of them, both to limit network traffic and to simplify the implementation.
https://github.com/zakki/cgos/tree/genmove_analyze
https://twitter.com/k_matsuzaki/status/ ... 1746693120
If engine supports "kata-genmove_analyze" or "lz-genmove_analyze", clinet-python sends pv and winrates to server.
I think we need to define a subset of them, both to limit network traffic and to simplify the implementation.
-
- Posts: 219
- Joined: Tue Feb 12, 2008 8:31 pm
- Contact:
Re: Python version of CGOS by Zakki
Hi,
Great to have you here. Welcome to the forum!
It is really great to be able to visualize evaluation plots from CGOS. What are the specs of those gtp extensions so that I can implement it in my program?
Rémi
Great to have you here. Welcome to the forum!
It is really great to be able to visualize evaluation plots from CGOS. What are the specs of those gtp extensions so that I can implement it in my program?
Rémi
Re: Python version of CGOS by Zakki
Current implementation uses LeelaZero's lz-genmove_analyze and KataGo's kata-genmove_analyze specification, and wgo viewer uses 'move', 'winrate', 'pv' and 'ownership' attributes.
https://github.com/zakki/cgos/wiki/GTP- ... -expansion
https://github.com/zakki/cgos/wiki/GTP- ... -expansion
-
- Posts: 27
- Joined: Sat Oct 30, 2021 1:31 am
Re: Python version of CGOS by Zakki
Current test CGOS server is running.
http://203.138.189.63/cgos/19x19/standings.html
you can see ownership by selecting left top menu "CGOS mode".
http://203.138.189.63/cgos/viewer.cgi?1 ... /23/13.sgf
You can also see multiple candidates move's pv by focusing mouse on stones which are printed winrate and score.
Any comment is welcome!
https://github.com/zakki/cgos/tree/genmove_analyze
https://github.com/zakki/cgos/wiki/GTP- ... -extension
example of genmove. (without ownership)
cgos-genmove_analyze w
=
{"moves": [{"move": "O15", "winrate": 0.135, "score": -11.21, "pv": "O15 P17 O18 N17 O8 P6 N7 Q7 O6 P5"}]}
play O15
How to connect:
https://github.com/zakki/cgos/tree/genm ... python/src
All 5 *.py on src directory, and write sample.cfg, and make sgf directory, and run this.
$ python3 ../src/cgosclient.py sample.cfg
$ cat sample.cfg
Common:
KillFile = abort.txt
GTPEngine:
Name = dummy_name
CommandLine = ../../katago_1.12.1/cpp/katago gtp -model ../../kata_dist/b18c384nbt-uec.bin.gz -config ../../katago_1.12.1/gtp_v50.cfg
ServerHost = 203.138.189.63
ServerPort = 6819
ServerUser = kata1_b18_uec_v50
ServerPassword = yoursecret
NumberOfGames = 5
SGFDirectory = sgf
http://203.138.189.63/cgos/19x19/standings.html
you can see ownership by selecting left top menu "CGOS mode".
http://203.138.189.63/cgos/viewer.cgi?1 ... /23/13.sgf
You can also see multiple candidates move's pv by focusing mouse on stones which are printed winrate and score.
Any comment is welcome!
https://github.com/zakki/cgos/tree/genmove_analyze
https://github.com/zakki/cgos/wiki/GTP- ... -extension
example of genmove. (without ownership)
cgos-genmove_analyze w
=
{"moves": [{"move": "O15", "winrate": 0.135, "score": -11.21, "pv": "O15 P17 O18 N17 O8 P6 N7 Q7 O6 P5"}]}
play O15
How to connect:
https://github.com/zakki/cgos/tree/genm ... python/src
All 5 *.py on src directory, and write sample.cfg, and make sgf directory, and run this.
$ python3 ../src/cgosclient.py sample.cfg
$ cat sample.cfg
Common:
KillFile = abort.txt
GTPEngine:
Name = dummy_name
CommandLine = ../../katago_1.12.1/cpp/katago gtp -model ../../kata_dist/b18c384nbt-uec.bin.gz -config ../../katago_1.12.1/gtp_v50.cfg
ServerHost = 203.138.189.63
ServerPort = 6819
ServerUser = kata1_b18_uec_v50
ServerPassword = yoursecret
NumberOfGames = 5
SGFDirectory = sgf
-
- Posts: 219
- Joined: Tue Feb 12, 2008 8:31 pm
- Contact:
Re: Python version of CGOS by Zakki
Great job!
Strangely, I could not see any data from the sgf you linked. But I could on this one:
http://203.138.189.63/cgos/viewer.cgi?1 ... 24/207.sgf
It is difficult to guess the meaning of the plot. Which color is which player?
I am a bit busy now, but I plan to implement the gtp extension in Crazy Stone soon, and connect to the server.
Rémi
Strangely, I could not see any data from the sgf you linked. But I could on this one:
http://203.138.189.63/cgos/viewer.cgi?1 ... 24/207.sgf
It is difficult to guess the meaning of the plot. Which color is which player?
I am a bit busy now, but I plan to implement the gtp extension in Crazy Stone soon, and connect to the server.
Rémi
-
- Posts: 219
- Joined: Tue Feb 12, 2008 8:31 pm
- Contact:
Re: Python version of CGOS by Zakki
Hi,
So I made a first try today. This is the game it produced:
http://203.138.189.63/cgos/viewer.cgi?1 ... 26/425.sgf
It is a bit strange, because in order to produce a plot, I have to go to the end of the game, and undo moves one by one. Otherwise, nothing is displayed.
I started the game with the wrong version of the client (from trunk). In the middle of the game, I stopped the client and upgraded to the good branch. I am using cgos-genmove_analyze to send data. The data I sent is wrong, because the engine automatically starts pondering after generating a move, and the json was from the root of the pondering tree, not the tree that produced the move. I will fix this tomorrow.
One question: what is the difference between "Name" and "ServerUser" in the cfg file?
Rémi
So I made a first try today. This is the game it produced:
http://203.138.189.63/cgos/viewer.cgi?1 ... 26/425.sgf
It is a bit strange, because in order to produce a plot, I have to go to the end of the game, and undo moves one by one. Otherwise, nothing is displayed.
I started the game with the wrong version of the client (from trunk). In the middle of the game, I stopped the client and upgraded to the good branch. I am using cgos-genmove_analyze to send data. The data I sent is wrong, because the engine automatically starts pondering after generating a move, and the json was from the root of the pondering tree, not the tree that produced the move. I will fix this tomorrow.
One question: what is the difference between "Name" and "ServerUser" in the cfg file?
Rémi
-
- Posts: 219
- Joined: Tue Feb 12, 2008 8:31 pm
- Contact:
Re: Python version of CGOS by Zakki
Another remark: do you plot the win rate of the most visited move? Instead of plotting the win_rate and score of a single move, it would seem better to provide the win_rate and score (and visit count) at the root.
Re: Python version of CGOS by Zakki
Enable "CGOS mode" in "≡" menu. When CGOS mode is off, plot seems something wrong, I'll fix it later.Rémi Coulom wrote: ↑Thu Jan 26, 2023 7:26 pm It is a bit strange, because in order to produce a plot, I have to go to the end of the game, and undo moves one by one. Otherwise, nothing is displayed.
"Name" is used for local logging, and "ServerUser" is used for server login.Rémi Coulom wrote: ↑Thu Jan 26, 2023 7:26 pm One question: what is the difference between "Name" and "ServerUser" in the cfg file?
It seems good idea.Rémi Coulom wrote: ↑Thu Jan 26, 2023 7:33 pm Another remark: do you plot the win rate of the most visited move? Instead of plotting the win_rate and score of a single move, it would seem better to provide the win_rate and score (and visit count) at the root.
Lizzie aggregates all hands and uses a weighted average winning percentage.
I would consider adding winrate and score to root element and adding a converter to client-python for lz-genmove_analyze and kata-genmove_analyze.
-
- Posts: 219
- Joined: Tue Feb 12, 2008 8:31 pm
- Contact:
Re: Python version of CGOS by Zakki
Hi,
I fixed my bug: I was sending a multi-line json. Only the closing "}" was sent as analysis. That may have been a source of problems on your side. It may be worth documenting that the json must be on a single line.
I now send a single json line without spaces. It seems to be working better. I'll let it play a few games.
I may implement ownership later.
Rémi
I fixed my bug: I was sending a multi-line json. Only the closing "}" was sent as analysis. That may have been a source of problems on your side. It may be worth documenting that the json must be on a single line.
I now send a single json line without spaces. It seems to be working better. I'll let it play a few games.
I may implement ownership later.
Rémi