飞扬围棋论坛

 找回密码
 注册
搜索
查看: 19785|回复: 26

Leela分析脚本

[复制链接]
发表于 2017-10-3 10:12 | 显示全部楼层 |阅读模式
https://github.com/lightvector/leela-analysis
基于
https://bitbucket.org/mkmatlock/sgftools
增加功能
1.找出你的错误,并给出替换的变化

回复

使用道具 举报

发表于 2017-10-3 10:27 | 显示全部楼层
太牛了
回复 支持 反对

使用道具 举报

发表于 2017-10-3 11:03 | 显示全部楼层
不懂英文,烦请楼主给个下载和使用指南,方便棋友。
回复 支持 反对

使用道具 举报

发表于 2017-10-3 13:10 | 显示全部楼层
不错。
他这个是根据胜率来判断对错的。有时候一手棋错了,如果计算不充分,胜率并不会马上下降,可能好几步之后才发现。
我有个想法,对初级棋友来说,找出非常简单的错误就够了,比如某一步,如果leela在某一个选点上花的时间超过90%,其他的选点可以说毫无疑问是错误的。我们把这样的错误纠正过来,估计棋力就能提高很多了。等有空了,我改改看。
回复 支持 反对

使用道具 举报

发表于 2017-10-3 13:19 | 显示全部楼层
太牛逼了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-10-3 16:57 | 显示全部楼层
把页面右上角的clone or download绿色按钮点一下,下载zip文件
把它释放到leelaGTP目录
然后把某个sgf文件也放在那个目录,比如017.sgf
然后在cmd窗口
D:\>cd D:\Leela0105GTP
如果不用pypy也可以用python
D:\Leela0105GTP>\pypy2\pypy sgfanalyze.py 017.sgf --leela .\Leela0105GTP.exe  1>017_analyzed.sgf
Warning: Komi not specified, assuming 7.500000
Executing approx 33 analysis steps

|                                                  |   done% | Est... | done / total
|                                                  |   0.00% | Est... | 0 / 33
|=                                                 |   3.23% | 0:07:30 | 1 / 31
|===                                               |   6.90% | 0:05:18 | 2 / 29
|=====                                             |  11.11% | 0:03:44 | 3 / 27
|========                                          |  16.00% | 0:02:55 | 4 / 25
|==========                                        |  21.74% | 0:02:45 | 5 / 23
|==========                                        |  20.69% | 0:03:17 | 6 / 29
|============                                      |  25.93% | 0:03:02 | 7 / 27
|================                                  |  32.00% | 0:02:42 | 8 / 25
|===================                               |  39.13% | 0:02:15 | 9 / 23
|=======================                           |  47.62% | 0:01:45 | 10 / 21
|============================                      |  57.89% | 0:01:18 | 11 / 19
|==================================================| 100.00% | 0:00:00 | 19 / 19
|==================================================| 100.00% | 0:00:00 | 19 / 19
|==================================================| 100.00% | Done. | Elapsed Time: 0:04:04
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-10-3 16:58 | 显示全部楼层
分析前后的文件

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-10-3 17:07 | 显示全部楼层
可以用multigo 打开017_analyzed.sgf
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-10-3 17:12 | 显示全部楼层
脚本的选项

D:\Leela0105GTP>\pypy2\pypy sgfanalyze.py --help
usage: sgfanalyze.py [-h] [--start MOVENUM] [--stop MOVENUM]
                     [--analyze-thresh T] [--var-thresh T]
                     [--secs-per-search S] [--nodes-per-var N]
                     [--win-graph PDF] [-v V] --leela CMD [--cache DIR]
                     [--restarts N] [--wipe-comments] [--skip-white]
                     [--skip-black]
                     SGF_FILE

positional arguments:
  SGF_FILE             SGF file to analyze

optional arguments:
  -h, --help           show this help message and exit
  --start MOVENUM      Analyze game starting at this move (default=0)
  --stop MOVENUM       Analyze game stopping at this move (default=1000)
  --analyze-thresh T   Display analysis on moves losing approx at least this
                       much win rate when the game is close (default=0.03)
  --var-thresh T       Explore variations on moves losing approx at least this
                       much win rate when the game is close (default=0.03)
  --secs-per-search S  How many seconds to use per search (default=10)
  --nodes-per-var N    How many nodes to explore with leela in each variation
                       tree (default=8)
  --win-graph PDF      Output pdf graph of win rate to this file, must have
                       matplotlib installed
  -v V, --verbosity V  Set the verbosity level, 0: progress only, 1:
                       progress+status, 2: progress+status+state
  --cache DIR          Set a directory to cache partially complete analyses,
                       default ~/.leela_checkpoints
  --restarts N         If leela crashes, retry the analysis step this many
                       times before reporting a failure
  --wipe-comments      Remove existing comments from the main line of the SGF
                       file
  --skip-white         Do not display analysis or explore variations for white
                       mistakes
  --skip-black         Do not display analysis or explore variations for black
                       mistakes

required named arguments:
  --leela CMD          Command to run Leela executable
回复 支持 反对

使用道具 举报

发表于 2017-10-3 19:46 | 显示全部楼层
lu01 发表于 2017-10-3 16:57
把页面右上角的clone or download绿色按钮点一下,下载zip文件
把它释放到leelaGTP目录
然后把某个sgf文 ...

谢谢
回复 支持 反对

使用道具 举报

发表于 2017-10-3 20:01 | 显示全部楼层
一盘棋要分析很久吧。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-10-3 20:59 | 显示全部楼层
ILoveBt2 发表于 2017-10-3 20:01
一盘棋要分析很久吧。

可指定参数
回复 支持 反对

使用道具 举报

发表于 2017-10-4 00:08 | 显示全部楼层
pypy 是什么,还是不会用
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-10-4 10:04 | 显示全部楼层
sxy 发表于 2017-10-4 00:08
pypy 是什么,还是不会用

python的一个变种,从pypy.org下载,你也可以用python.org的python
回复 支持 反对

使用道具 举报

发表于 2017-10-4 14:42 | 显示全部楼层
lu01 发表于 2017-10-4 10:04
python的一个变种,从pypy.org下载,你也可以用python.org的python

搞定了!谢谢啦
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|Archiver|手机版|飞扬围棋网 ( 苏ICP备11029047号-1 )

GMT+8, 2024-3-29 16:18 , Processed in 0.152363 second(s), 20 queries .

since 2003飞扬围棋论坛 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表