lightvector / leela-analysis Goto Github PK
View Code? Open in Web Editor NEWAnalysis scripts for Leela
License: Other
Analysis scripts for Leela
License: Other
Hi, we can have this kind of display (see below).
It would be good to have it sorted and labelled accordingly.
A -> Win%: 49.01% (8200 visits)
B -> Win%: 47.03% (12611 visits)
C -> Win%: 46.78% (5269 visits)
D -> Win%: 47.38% (4509 visits)
E -> Win%: 46.98% (4082 visits)
F -> Win%: 44.97% (1787 visits)
G -> Win%: 46.81% (736 visits)
I seem to be getting an error running on a 9x9 game generated from OGS. Here is a sample output followed by the files.
C:\Leela0100GTP\leela-analysis-master>sgfanalyze.py "9336957-056-Prester Jane-brose.sgf" --leela C:\Leela0100GTP\Leela0100GTP_OpenCL.exe > PresterJane-brose.sgf
Executing approx 168 analysis steps
| | done% | Est... | done / total
| | 0.00% | Est... | 0 / 168
WARNING: analysis stats missing data mc_winrate
WARNING: analysis stats missing data nn_winrate
WARNING: analysis stats missing data margin
| | 0.60% | 0:37:51 | 1 / 166
WARNING: analysis stats missing data mc_winrate
WARNING: analysis stats missing data nn_winrate
WARNING: analysis stats missing data margin
| | 1.22% | 0:34:03 | 2 / 164
A suggestion: the graph is not well readable if there are lines, I think it is easier to identify when (at which move) something happens if the graph has no lines and a slightly different dimension. Also, without reading Leela's doc, it is not clear whose win rate the script is showing.
Therefore, my suggestion for lines 30ff in the main script:
plt.figure(1, figsize=(7,3.6))
plt.axhline(0.5, 0, max(winrates.keys()), linestyle='--', color='0.7')
plt.plot(X, Y, linestyle='None', color='k', marker='+')
plt.xlim(0, max(winrates.keys()))
plt.ylim(0, 1)
plt.xlabel("Move number", fontsize=12)
plt.ylabel("Black's win rate", fontsize=12)
plt.savefig(outp_fn, dpi=200, format='pdf', bbox_inches='tight')
Thanks for maintaining this! I use it on all my games and learn a lot.
Thank you for what I know was a lot of work and which I hope will improve my go playing and analysis
I know some python, the python installed as a system default is Anaconda 3.6 so I am using a winpython 2.7
to run the program mybat.bat is my running script. When I run the program seems to write a zero length
sgf file and then proceed to do its analysis. Can you offer any advice. Is there an email address or phone number where I can contact you directly. My email is laefsky AT comcast DOT net
Windows Bat File Follows
.\python.exe E:\leela-analysis-master\sgfanalyze.py -v3 E:\downloads\testa.sgf --leela E:\Leela0110GTP\Leela0110GTP_OpenCL.exe > test2.sgf
my email is : laefsky AT comcast DOT net
when i want to use mtcs to play ,it rasied error :
File "/home/mrmartinke/Desktop/MuGo-master/strategies.py", line 265, in estimate_value
current = copy.deepcopy(leaf_position)
NameError: name 'copy' is not defined
so i import copy ,the game can run ,but it rasied this everytime :
Move: 4. Captures X: 0 O: 0
max rollout depth exceeded!
value: 23.0
tree search
thanks for your help!
The function graph_winrates() inverts win rates according to colour, but this has been done somewhere else before, so a winrate that should be constant becomes a triangle curve.
Fix: remove lines 25 and 26 of sfganalyze.py
for move_num in sorted(winrates.keys()):
pl, wr = winrates[move_num]
# if pl != color:
# wr = 1. - wr
X.append(move_num)
Y.append(wr)
Thanks for your project! I sign up a account to star your work. It's real helpful!
There is another author have already done a similar project. https://github.com/aniljava/leela-variations
I think this may help you to improve your project.
Best wishes!
If a move already has a comment leela-analysis should, (could?) start its comments on a new line or at least a space.
Hi, there is a clear horizon effect on hard games, by example: black win rate = 50% white makes a move. then black win rate drops to 20%.
It comes from the fact the analysis is probably done forward but performing the analysis backward would fix this kind of issue (because leela engine keeps track of explored sub-tree), it will not make leela that much reliable but it will improve it's evaluation with the game main line as an hint. And more importantly it makes the analysis more consistent with itself.
So performing the evalution backward from last move to first move is probably a real quick win for the script!
thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.