Skip to content

Commit

Permalink
Tweak WDL model params
Browse files Browse the repository at this point in the history
Bench: 2141682
  • Loading branch information
SzilBalazs committed Aug 14, 2023
1 parent 94ec60c commit 58d8f48
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions scripts/wdl_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
if score > 700 or score < -700:
continue

# Skip positions with blunders because they were generated as low depth data.
if score > 200 and wdl == -1:
continue
if score < -200 and wdl == 1:
continue

if score not in wins:
wins[score] = 0
losses[score] = 0
Expand Down
2 changes: 1 addition & 1 deletion src/search/terminal_report.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ namespace search::report {
}

if (show_wdl) {
auto [w, l] = cp_to_wl(score);
auto [w, l] = wdl_model::cp_to_wl(score);
int d = 1000 - w - l;
res << " wdl " << w << " " << d << " " << l;
}
Expand Down
8 changes: 4 additions & 4 deletions src/search/wdl_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
#include <cmath>
#include <utility>

namespace search {
namespace search::wdl_model {

constexpr float win_polynomial[5] = {
-2.48486993e-12, -1.35086324e-09, 1.63515294e-06, 1.28794334e-03, 2.27129636e-01};
-2.47316297e-12, -1.48747168e-09, 1.63383657e-06, 1.34567185e-03, 2.26139615e-01};

constexpr float loss_polynomial[5] = {
-2.33054260e-12, 1.40330209e-09, 1.53833569e-06, -1.31063191e-03, 2.43447833e-01};
-2.31486122e-12, 1.54329009e-09, 1.53565431e-06, -1.36965421e-03, 2.41690462e-01};

std::pair<int, int> cp_to_wl(Score score) {

Expand All @@ -52,4 +52,4 @@ namespace search {

return {std::round(win_chance * 1000), std::round(loss_chance * 1000)};
}
} // namespace search
} // namespace search::wdl_model

0 comments on commit 58d8f48

Please sign in to comment.