kobanium / aobazero

Aoba Zero
Other
54 stars 8 forks source link

v1.2への修正に伴う変化 #7

Open yssaya opened 5 years ago

yssaya commented 5 years ago

今回の修正で棋譜の特性がかなり変わりました。1万局ぐらいの平均です。

          aobaz8 aobaz9 勝率         0.610 0.528 Rootで試した手の数   42.8   13.5 平均手数        115.5  132.6 引き分け(1000局中)   11.2  23.7

目立つのは勝率で0.610から0.528まで急激に互角に近づきました。 0.52程度は現在の棋力(アマ5段)では正しい数値だと思います。 やはり以前のは30手後の局面が先手有利に増幅されていたのでしょう。

Rootで試した手の数も42手から13手と激減しています。 cINITが倍になってるので、より多くの手を試すようになってる はずですが、それよりも初期値-1による効果が大きそうです。

平均手数も115手から132手に上がってます。 直観的には「-m 30」でばらける時に、ひどい悪手が選ばれにくくなったせいかと思います。

引き分けが11局から23局に増えてるのは互角の展開が増えたことによる512手超え かと思われます。棋力が上がったことによる千日手が増えてせいかもしれません。 (どちらの要因かは未確認)。 AobaZeroでは27点法(同点は後手勝)を採用してるので通常の将棋(持将棋は0.3%程度) より、もっと出現率が少ないはずなのですが。23局全部だと、2%が引き分けです。

floodgate では AobaZero_w537_n_p800 からv1.2を使っています。 また探索木の再利用もしています(これは現在テスト中で近日中に組み込みます)。 v1.2の変更で+240、探索木の再利用で+130、合計+370ほど自己対戦では強くなる計算です。 floodgateでは +368 ほど強くなったように見えます。これはネットワークよりも ほぼ探索部の変更によるものです。

AobaZero_w537_n_p800 2910 AobaZero_w529_n_p800 2542

AobaZero_w537_n_p800 http://wdoor.c.u-tokyo.ac.jp/shogi/view/show-player.cgi?user=AobaZero_w537_n_p800

強くなっていますが、「-n」オプションをつけたことによるRootでのノイズの影響が かなり小さくなって、同一の棋譜になってしまうケースが多いようです。 floodgateでは 「aobaz -p 800 -n -q -w weight_save/w000000000537.txt」 というオプションで動かしています。

評価値は勝率をponanzaの山本さんの式を元に変換しています。

Ponanzaは評価値と勝率に以下の式の関係があると仮定して学習しています。 大体300点くらいで勝率6割、800点で勝率8割くらいです。 https://twitter.com/issei_y/status/589642166818877440

今回のMCTSの勝率の初期値の変更はMiacisさんのブログで言及されていたのが 気づいた理由です(山岡さんのブログでも書かれていた気がします)。

Policyの教師信号を分布にする (選手権参加のMiacisさんのブログ)

AlphaZeroはValueを[0, 1]の範囲に直して探索している AlphaZeroの0初期化は負けの値だという気になる言及あり https://tokumini.hatenablog.com/entry/2019/05/22/180000 https://tokumini.hatenablog.com/entry/2019/04/08/180000

pcutにおける、未展開の手の勝率(value)の値は 0(引き分け)ではなく -1(負け)らしいです。

Yes, all values are initialized to loss value. http://talkchess.com/forum3/viewtopic.php?f=2&t=69175&start=70#p781765 投稿者の matthewlai さんはAlphaZeroの一員です(Matthew Lai)。

LCZeroのブログでも初期値は負け(-1)の記述があります。

First Play Urgency value is known now. It's -1! https://blog.lczero.org/2018/12/alphazero-paper-and-lc0-v0191.html

pseudocode.py にも下の記述があります(AlphaZeroは探索内部では +1,0,-1 でなく 0,+1 らしいです) if self.visit_count == 0: return 0

2016年のAlphaGo論文では下記の記述から [-1, +1] なので 2018年論文も [-1, +1] じゃないか?と判断していました。

Mastering the Game of Go with Deep Neural Networks and Tree Search(2016年 AlphaGo)

AlphaGo resigns when its overall evaluation drops below an estimated 10% probability of winning the game, i.e. max Q(s,a) < -0.8

ただ、2017年10月のAlphaGoZero論文では下記の記述があり、

"The value v is a scalar evaluation, estimating the probability of the current player winning from positions."

おそらく2016年の論文では [-1 <= x <= +1] だったのが2017年の論文では [0 <= x <= +1] に 変更になったようです。

2018年12月に公開された pseudocode.py が正しい、と判断しました。 pseudocode.py 内部は [0, +1] で AobaZeroでは [-1, +1] なので それに応じて cINIT の値(1.25)も2倍にしています。

A general reinforcement learning algorithm that masters chess, shogi, and Go through self-play に含まれるSupplementary Materials https://science.sciencemag.org/content/suppl/2018/12/05/362.6419.1140.DC1 pseudocode.py が含まれるzip https://science.sciencemag.org/highwire/filestream/719481/field_highwire_adjunct_files/1/aar6404_DataS1.zip

sbbdms commented 5 years ago

Hi! I have 2 questions about the current status of AobaZero:

(1) According to the Elo rating on FloodGate, it seems that from weight No.537 to weight No.568, AobaZero's strength doesn't have much gain. Instead, it fluctuates very much. The Elo of weight No.568 even appears weaker. How do you assess the current status? Is AobaZero still gaining strength or it has hit a bottleneck? If the latter, do you have any plan dealing with?

(2) During the process participating in this project, I notice that, the sizes of weight files seems to become gradually smaller (At least since weight No.539, after AobaZero v1.2 released). It feels strange because IMHO, the things that weight files record are parameters, it shouldn't have any regularity on either the length of parameters, or the size of weight files. Is this phenomenon explainable?

Thanks!

screenshot

yssaya commented 5 years ago

Yes, w568 looks weak, but there is only 25 games. So I'd like to see more games. And we found each weight strength is not stable. I have attached details as follows.

the sizes of weight files seems to become gradually smaller

Wow, this is interesting. I can not guess this reason. One idea is root node candidates moves are decrease from 42 to 13 since v1.2. So NN may decrease these move parameters.

w0538.txt ...w0537.txt 115-107-13 winrate=0.517 +12 Elo stronger previous weight w0539.txt ...w0538.txt 113-130-19 winrate=0.467 -23 w0540.txt ...w0539.txt 88- 87-11 winrate=0.502 +1 w0541.txt ...w0540.txt 99-147- 9 winrate=0.405 -67 w0542.txt ...w0541.txt 148- 98-13 winrate=0.596 +68 w0543.txt ...w0542.txt 96-111-10 winrate=0.465 -24 w0544.txt ...w0543.txt 126-105-10 winrate=0.543 +30 w0545.txt ...w0544.txt 99-109-12 winrate=0.477 -16 w0546.txt ...w0545.txt 79-114- 7 winrate=0.412 -62 w0547.txt ...w0546.txt 97-119-13 winrate=0.451 -34 w0548.txt ...w0547.txt 123-117-16 winrate=0.511 +8 w0549.txt ...w0548.txt 130-112- 9 winrate=0.535 +24 w0550.txt ...w0549.txt 155-152-22 winrate=0.504 +3 w0551.txt ...w0550.txt 104- 86-12 winrate=0.544 +31 w0552.txt ...w0551.txt 93-133-11 winrate=0.415 -60 w0553.txt ...w0552.txt 103-101-13 winrate=0.504 +3 w0554.txt ...w0553.txt 140- 95- 9 winrate=0.592 +65 w0555.txt ...w0554.txt 122-106-15 winrate=0.532 +22 w0556.txt ...w0555.txt 101-113-15 winrate=0.473 -19 w0557.txt ...w0556.txt 121-119-12 winrate=0.503 +2 w0558.txt ...w0557.txt 258-208-28 winrate=0.550 +35 w0559.txt ...w0558.txt 128-165-15 winrate=0.439 -43