Use winning_percentage_wdl in learn #90
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
こんばんは。
以前のプルリクエスト( #36 )と同様に
評価関数の学習時にWDLを使うオプションを追加してみました。
learn use_wdl 1 ...のように指定すると、sigmoidを使うwinning_percentage()の代わりにwin rate modelによるWDLを用いた勝率を使うようになります。
以前のプルリクエストの際はクロスエントロピーの微分が難しく、一旦Revertして頂きました。
今回の実装では解析的な微分はあきらめて、数値微分にしました。
デバッグ用に、(WDLではなく)通常のsigmoidによる勝率の場合に
数値微分で計算した結果と、解析的な微分結果である(q - p)や(q - t)を比べると
誤差の範囲でほぼ一致することを確認しました。
(スケールをあわせるため、数値微分の結果をwinning_probability_coefficientで割っています)
最近導入されたconvert_teacher_signal_to_winning_probabilityが指定された場合にも対応したつもりです。
なお、LOSS_FUNCTIONとしては、今回はLOSS_FUNCTION_IS_ELMO_METHODにだけ対応しました。
ただ、手元で少し学習させてみましたところ、学習にはあまり効果がないようでした。(というより、逆効果でした)
※現在、機械学習バイナリのリリースに向けて、Stockfish masterマージ後のリグレッションテストを実施されている旨、twitterで拝見しました。
このプルリクエストをマージして頂ける場合、次回リリース後で構いません。