{"id":1809,"date":"2019-11-21T19:03:31","date_gmt":"2019-11-21T10:03:31","guid":{"rendered":"http:\/\/go-w.jp\/?p=1809"},"modified":"2019-12-05T21:20:11","modified_gmt":"2019-12-05T12:20:11","slug":"katago%e3%81%ae%e7%9b%ae%e6%95%b0%e4%ba%88%e6%83%b3%e3%81%ae%e6%8e%a8%e7%a7%bb%e3%82%92%e3%82%b0%e3%83%a9%e3%83%95%e5%8c%96","status":"publish","type":"post","link":"https:\/\/go-w.jp\/?p=1809","title":{"rendered":"KataGo\u306e\u76ee\u6570\u4e88\u60f3\u306e\u63a8\u79fb\u3092 Python \u3067\u30b0\u30e9\u30d5\u5316"},"content":{"rendered":"<p><del datetime=\"2019-11-23T08:33:44+00:00\">KataGo \u3067\u76ee\u6570\u8a55\u4fa1\u306f\u3067\u304d\u308b\u3082\u306e\u306e\u3001Lizzie \u3067\u52dd\u7387\u30b0\u30e9\u30d5\u306e\u3088\u3046\u306b\u30b0\u30e9\u30d5\u3092\u51fa\u3059\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/del><br \/>\n11\/23 \u8ffd\u8a18\u3000\u306a\u3093\u3068\u3044\u3046\u5927\u5618\u30fb\u8d64\u3063\u6065\u3000\u2193\u3053\u306e\u8d64\u7d2b\u306e\u7dda\u306f\u306a\u3093\u3060\uff1f\uff1f\u3000\uff08\u82e6\u7b11\uff09<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/go-w.jp\/wp-content\/uploads\/7a20e78668a7d38336195288486ab043-313x262.png\" alt=\"\" width=\"313\" height=\"262\" class=\"alignnone size-medium wp-image-1826\" srcset=\"https:\/\/go-w.jp\/wp-content\/uploads\/7a20e78668a7d38336195288486ab043-313x262.png 313w, https:\/\/go-w.jp\/wp-content\/uploads\/7a20e78668a7d38336195288486ab043.png 531w\" sizes=\"auto, (max-width: 313px) 100vw, 313px\" \/><br \/>\nPython \u3067\u30b0\u30e9\u30d5\u3092\u63cf\u304f\u7df4\u7fd2\u8a18\u4e8b\u3068\u3044\u3046\u3053\u3068\u3067\u3002<br \/>\n\uff08\u8ffd\u8a18\u3053\u3053\u307e\u3067\uff09<\/p>\n<p>KataGo \u3067\u5206\u6790\u3092\u304a\u3053\u306a\u3063\u3066\u68cb\u8b5c\u3092\u4fdd\u5b58\u3059\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u306b\u76ee\u6570\u8a55\u4fa1\u306e\u30c7\u30fc\u30bf\u304c\u66f8\u304d\u8fbc\u307e\u308c\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u5229\u7528\u3057\u3066 Python \u3067\u30b0\u30e9\u30d5\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u9053\u7b56 vs \u5b89\u4e95\u7b97\u77e5(\uff12\u5b50\uff09 \u3067\u9053\u7b56\uff11\u76ee\u8ca0\u3051\u3001\u300c\u9053\u7b56\u7562\u751f\u306e\u540d\u5c40\u300d\u3068\u3057\u3066\u4f1d\u3048\u3089\u308c\u3066\u3044\u308b\u7881\u3067\u3059\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1805\" src=\"http:\/\/go-w.jp\/wp-content\/uploads\/88b2b6ad036c5a1772d4039ed5dfdd39-313x196.png\" alt=\"\" width=\"313\" height=\"196\" srcset=\"https:\/\/go-w.jp\/wp-content\/uploads\/88b2b6ad036c5a1772d4039ed5dfdd39-313x196.png 313w, https:\/\/go-w.jp\/wp-content\/uploads\/88b2b6ad036c5a1772d4039ed5dfdd39-626x391.png 626w, https:\/\/go-w.jp\/wp-content\/uploads\/88b2b6ad036c5a1772d4039ed5dfdd39-768x480.png 768w, https:\/\/go-w.jp\/wp-content\/uploads\/88b2b6ad036c5a1772d4039ed5dfdd39.png 1440w\" sizes=\"auto, (max-width: 313px) 100vw, 313px\" \/><\/p>\n<p>SGF\u30d5\u30a1\u30a4\u30eb\u3092\u307f\u3066\u307f\u308b\u3068\uff11\u624b\u3054\u3068\u306b scoreMean: \u3068\u3044\u3046\u884c\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u305d\u308c\u3092\u5229\u7528\u3057\u307e\u3059\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1810\" src=\"http:\/\/go-w.jp\/wp-content\/uploads\/f24ab98fb999c5e406f7322c0f0d0949-313x281.png\" alt=\"\" width=\"313\" height=\"281\" srcset=\"https:\/\/go-w.jp\/wp-content\/uploads\/f24ab98fb999c5e406f7322c0f0d0949-313x281.png 313w, https:\/\/go-w.jp\/wp-content\/uploads\/f24ab98fb999c5e406f7322c0f0d0949.png 434w\" sizes=\"auto, (max-width: 313px) 100vw, 313px\" \/><\/p>\n<p>\u4ee5\u4e0b\u304c\u30bd\u30fc\u30b9\u3002 \u4f8b\u3048\u3070mokusu.py \u3068\u3057\u3066\u4fdd\u5b58\u3057\u3066\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067<\/p>\n<p>python mokusu.py xxxxxx.sgf<\/p>\n<p>\u3068\u3044\u3046\u3075\u3046\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u2193 2019\/11\/22 \u30d0\u30b0\u4fee\u6b63\u3002 \u8ca0\u306e\u76ee\u6570\u5dee\u3092\u6b63\u306b\u3057\u3066\u3044\u305f\u306e\u3092\u3001\u5076\u6570\u624b\u76ee\u306b\u6b63\u8ca0\u53cd\u8ee2<br \/>\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000png \u3092 sgf \u3068\u540c\u3058\u5834\u6240\u3001\u540c\u3058\u540d\u524d\u3067\u4fdd\u5b58\u3059\u308b\u3088\u3046\u306b\u3057\u305f grid\u3092\u5165\u308c\u305f<\/p>\n<blockquote><p>\nimport sys<br \/>\nimport os<br \/>\nimport re<br \/>\nimport matplotlib.pyplot as plt<br \/>\ndef main():<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;mokusu_list=[]<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;tesu_list=[]<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;mokusu=0<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;tesu=0<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;input_file = sys.argv[1]<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;png_file = os.path.splitext(os.path.abspath(input_file))[0]+\".png\"<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;with open(input_file,'r',encoding=\"utf-8_sig\") as f:<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lines = f.readlines()<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;for line in lines:<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if re.search(r'^scoreMean', line):<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tesu = tesu + 1<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line = line.replace('scoreMean: ','')<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mokusu = float(line)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (tesu % 2) == 0:<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mokusu = mokusu * (-1)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mokusu_list.append(mokusu)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tesu_list.append(tesu)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;plt.plot(tesu_list, mokusu_list)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;plt.grid(True)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;plt.savefig(png_file)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;plt.show()<br \/>\nif __name__ == '__main__':<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;main()<\/p>\n<\/blockquote>\n<p>\u3067\u304d\u305f\u30b0\u30e9\u30d5\u304c\u3053\u3061\u3089\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/go-w.jp\/wp-content\/uploads\/dosaku-313x235.png\" alt=\"\" width=\"313\" height=\"235\" class=\"alignnone size-medium wp-image-1823\" srcset=\"https:\/\/go-w.jp\/wp-content\/uploads\/dosaku-313x235.png 313w, https:\/\/go-w.jp\/wp-content\/uploads\/dosaku-626x470.png 626w, https:\/\/go-w.jp\/wp-content\/uploads\/dosaku.png 640w\" sizes=\"auto, (max-width: 313px) 100vw, 313px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>KataGo \u3067\u76ee\u6570\u8a55\u4fa1\u306f\u3067\u304d\u308b\u3082\u306e\u306e\u3001Lizzie \u3067\u52dd\u7387\u30b0\u30e9\u30d5\u306e\u3088\u3046\u306b\u30b0\u30e9\u30d5\u3092\u51fa\u3059\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002 11\/23 \u8ffd\u8a18\u3000\u306a\u3093\u3068\u3044\u3046\u5927\u5618\u30fb\u8d64\u3063\u6065\u3000\u2193\u3053\u306e\u8d64\u7d2b\u306e\u7dda\u306f\u306a\u3093\u3060\uff1f\uff1f\u3000\uff08\u82e6\u7b11\uff09 Python \u3067\u30b0\u30e9\u30d5\u3092\u63cf\u304f\u7df4\u7fd2\u8a18 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":1823,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,26],"tags":[29,36],"class_list":["post-1809","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it","category-igo_ai","tag-katago","tag-python"],"_links":{"self":[{"href":"https:\/\/go-w.jp\/index.php?rest_route=\/wp\/v2\/posts\/1809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/go-w.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/go-w.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/go-w.jp\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/go-w.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1809"}],"version-history":[{"count":16,"href":"https:\/\/go-w.jp\/index.php?rest_route=\/wp\/v2\/posts\/1809\/revisions"}],"predecessor-version":[{"id":1829,"href":"https:\/\/go-w.jp\/index.php?rest_route=\/wp\/v2\/posts\/1809\/revisions\/1829"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/go-w.jp\/index.php?rest_route=\/wp\/v2\/media\/1823"}],"wp:attachment":[{"href":"https:\/\/go-w.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/go-w.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/go-w.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}