Skip to content

Commit

Permalink
Disable policy optimism for human sl nets
Browse files Browse the repository at this point in the history
  • Loading branch information
lightvector committed Jun 17, 2024
1 parent 47e18da commit 18dfa77
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 33 deletions.
7 changes: 6 additions & 1 deletion cpp/neuralnet/nneval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ void NNEvaluator::evaluate(
const BoardHistory& history,
Player nextPlayer,
const SGFMetadata* sgfMeta,
const MiscNNInputParams& nnInputParams,
const MiscNNInputParams& nnInputParamsArg,
NNResultBuf& buf,
bool skipCache,
bool includeOwnerMap
Expand All @@ -690,6 +690,11 @@ void NNEvaluator::evaluate(
" and requireExactNNLen, but was asked to evaluate board with different x or y size");
}

// Avoid using policy optimism for humanSL
MiscNNInputParams nnInputParams = nnInputParamsArg;
if(numInputMetaChannels > 0)
nnInputParams.policyOptimism = 0.0;

Hash128 nnHash = NNInputs::getHash(board, history, nextPlayer, nnInputParams);
if(numInputMetaChannels > 0) {
if(sgfMeta == NULL)
Expand Down
34 changes: 17 additions & 17 deletions cpp/tests/results/gtp/humansl.log
Original file line number Diff line number Diff line change
Expand Up @@ -431,23 +431,23 @@ whiteScoreSq 1848.532
shorttermWinlossError 0.236
shorttermScoreError 2.792
policy
0.000001 0.000001 0.002207 0.001345 0.000118 0.000027 0.000003 0.000001 0.000001 0.000001 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000001
0.000000 0.000003 0.002997 0.038435 0.082356 NAN 0.000025 0.000475 0.000128 0.000084 0.000018 0.000007 0.000004 0.000002 0.000005 0.000006 0.000005 0.000001 0.000000
0.000000 0.000095 0.028773 0.000479 NAN NAN 0.002703 0.049921 0.030046 0.054650 0.018700 0.004238 0.002597 0.001593 0.000032 0.000027 0.000154 0.000003 0.000000
0.000000 0.001101 0.000748 NAN 0.000036 NAN NAN 0.037289 0.020997 0.057154 0.012010 0.003406 0.000804 0.000158 0.000003 NAN 0.000010 0.000001 0.000000
0.000000 0.000489 0.006356 0.000457 0.000560 NAN 0.434344 0.002995 0.001435 0.000805 0.000110 0.000044 0.000019 0.000007 0.000004 0.000002 0.000009 0.000001 0.000000
0.000000 0.000065 0.023424 0.004072 0.000207 0.000111 0.000612 0.000737 0.000040 0.000016 0.000005 0.000004 0.000003 0.000002 0.000004 0.000040 0.000296 0.000001 0.000000
0.000000 0.000008 0.004669 0.002380 0.000060 0.000052 0.000035 0.000015 0.000003 0.000003 0.000001 0.000001 0.000002 0.000001 0.000004 0.000079 0.000203 0.000000 0.000000
0.000000 0.000004 0.001455 0.000794 0.000013 0.000008 0.000003 0.000002 0.000001 0.000002 0.000001 0.000001 0.000001 0.000001 0.000002 0.000025 0.000049 0.000000 0.000000
0.000000 0.000003 0.001851 0.000537 0.000005 0.000001 0.000001 0.000001 0.000001 0.000003 0.000001 0.000001 0.000001 0.000001 0.000003 0.000063 0.000120 0.000000 0.000000
0.000000 0.000006 0.007721 0.008900 0.000027 0.000002 0.000001 0.000002 0.000003 0.000165 0.000003 0.000001 0.000001 0.000002 0.000018 0.003111 0.001190 0.000001 0.000000
0.000000 0.000002 0.000779 0.000176 0.000003 0.000001 0.000000 0.000001 0.000001 0.000004 0.000001 0.000000 0.000000 0.000001 0.000002 0.000073 0.000082 0.000000 0.000000
0.000001 0.000001 0.002206 0.001344 0.000117 0.000027 0.000003 0.000001 0.000001 0.000001 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000001
0.000000 0.000003 0.002994 0.038473 0.082304 NAN 0.000025 0.000474 0.000127 0.000084 0.000018 0.000007 0.000004 0.000002 0.000005 0.000006 0.000005 0.000001 0.000000
0.000000 0.000094 0.028783 0.000477 NAN NAN 0.002694 0.049986 0.030050 0.054636 0.018708 0.004241 0.002596 0.001592 0.000032 0.000027 0.000154 0.000003 0.000000
0.000000 0.001099 0.000747 NAN 0.000036 NAN NAN 0.037293 0.020975 0.057129 0.012009 0.003407 0.000802 0.000157 0.000003 NAN 0.000010 0.000001 0.000000
0.000000 0.000488 0.006363 0.000456 0.000557 NAN 0.434341 0.002990 0.001431 0.000803 0.000110 0.000044 0.000019 0.000007 0.000004 0.000002 0.000009 0.000001 0.000000
0.000000 0.000064 0.023426 0.004075 0.000207 0.000111 0.000611 0.000734 0.000040 0.000016 0.000005 0.000004 0.000003 0.000002 0.000004 0.000040 0.000296 0.000001 0.000000
0.000000 0.000008 0.004667 0.002381 0.000060 0.000052 0.000035 0.000015 0.000003 0.000003 0.000001 0.000001 0.000001 0.000001 0.000004 0.000078 0.000203 0.000000 0.000000
0.000000 0.000004 0.001454 0.000794 0.000013 0.000008 0.000003 0.000002 0.000001 0.000002 0.000001 0.000001 0.000001 0.000001 0.000002 0.000025 0.000049 0.000000 0.000000
0.000000 0.000003 0.001850 0.000537 0.000005 0.000001 0.000001 0.000001 0.000001 0.000003 0.000001 0.000001 0.000001 0.000001 0.000003 0.000062 0.000120 0.000000 0.000000
0.000000 0.000006 0.007727 0.008913 0.000027 0.000002 0.000001 0.000002 0.000003 0.000165 0.000003 0.000001 0.000001 0.000002 0.000018 0.003112 0.001191 0.000001 0.000000
0.000000 0.000002 0.000778 0.000176 0.000003 0.000001 0.000000 0.000001 0.000001 0.000004 0.000001 0.000000 0.000000 0.000001 0.000002 0.000073 0.000082 0.000000 0.000000
0.000000 0.000001 0.000106 0.000027 0.000001 0.000001 0.000001 0.000001 0.000000 0.000001 0.000000 0.000000 0.000000 0.000001 0.000001 0.000024 0.000023 0.000001 0.000000
0.000000 0.000001 0.000462 0.000123 0.000003 0.000001 0.000001 0.000000 0.000000 0.000001 0.000000 0.000000 0.000001 0.000001 0.000002 0.000034 0.000056 0.000001 0.000000
0.000000 0.000006 0.010171 0.000907 0.000012 0.000003 0.000001 0.000000 0.000000 0.000001 0.000000 0.000000 0.000001 0.000001 0.000003 0.000023 0.000004 0.000001 0.000000
0.000000 0.000001 0.000461 0.000123 0.000003 0.000001 0.000001 0.000000 0.000000 0.000001 0.000000 0.000000 0.000001 0.000001 0.000002 0.000034 0.000056 0.000001 0.000000
0.000000 0.000006 0.010176 0.000908 0.000012 0.000003 0.000001 0.000000 0.000000 0.000001 0.000000 0.000000 0.000001 0.000001 0.000003 0.000023 0.000004 0.000001 0.000000
0.000000 0.000011 0.000302 0.000030 0.000027 0.000014 0.000002 0.000001 0.000001 0.000003 0.000001 0.000001 0.000002 0.000009 0.000020 0.000003 0.000002 0.000000 0.000000
0.000000 0.000074 0.000093 NAN 0.000019 0.000643 0.000082 0.000015 0.000029 0.000797 0.000052 0.000021 0.000077 0.001145 0.000509 0.000002 NAN 0.000000 0.000000
0.000000 0.000003 0.001183 0.000046 0.000192 0.006946 0.000201 0.000024 0.000061 0.000397 0.000111 0.000048 0.000128 0.002393 0.004157 0.000020 0.000001 0.000000 0.000000
0.000000 0.000074 0.000093 NAN 0.000019 0.000643 0.000082 0.000015 0.000029 0.000797 0.000052 0.000021 0.000077 0.001144 0.000508 0.000002 NAN 0.000000 0.000000
0.000000 0.000003 0.001183 0.000046 0.000192 0.006950 0.000201 0.000024 0.000061 0.000397 0.000111 0.000048 0.000128 0.002391 0.004162 0.000020 0.000001 0.000000 0.000000
0.000000 0.000001 0.000002 0.000036 0.000004 0.000005 0.000001 0.000001 0.000000 0.000000 0.000000 0.000000 0.000001 0.000002 0.000004 0.000002 0.000001 0.000001 0.000000
0.000001 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000001
policyPass 0.000000
Expand Down Expand Up @@ -624,8 +624,8 @@ PV: G14 F14 G13
Tree:
: T 11.33c W 10.90c S 0.43c ( +1.0 L +0.6) N 40 -- G14 F14 G13
---White(^)---
G14 : T 8.02c W 7.71c S 0.30c ( +0.7 L +0.5) LCB -61.75c P 22.84% WF 3.0 PSV 25 N 3 -- G14 F14 G13
F14 : T 11.63c W 11.19c S 0.44c ( +1.0 L +0.7) LCB 7.69c P 74.09% WF 36.0 PSV 14 N 36 -- F14 G14 G13 F13 G12
G14 : T 8.02c W 7.71c S 0.30c ( +0.7 L +0.5) LCB -61.75c P 22.84% WF 3.0 PSV 24 N 3 -- G14 F14 G13
F14 : T 11.63c W 11.19c S 0.44c ( +1.0 L +0.7) LCB 7.69c P 74.09% WF 36.0 PSV 15 N 36 -- F14 G14 G13 F13 G12

: = G14
: Controller: genmove b
Expand Down
30 changes: 15 additions & 15 deletions cpp/tests/results/gtp/humansl.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ whiteScoreSq 1848.532
shorttermWinlossError 0.236
shorttermScoreError 2.792
policy
0.000001 0.000001 0.002207 0.001345 0.000118 0.000027 0.000003 0.000001 0.000001 0.000001 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000001
0.000000 0.000003 0.002997 0.038435 0.082356 NAN 0.000025 0.000475 0.000128 0.000084 0.000018 0.000007 0.000004 0.000002 0.000005 0.000006 0.000005 0.000001 0.000000
0.000000 0.000095 0.028773 0.000479 NAN NAN 0.002703 0.049921 0.030046 0.054650 0.018700 0.004238 0.002597 0.001593 0.000032 0.000027 0.000154 0.000003 0.000000
0.000000 0.001101 0.000748 NAN 0.000036 NAN NAN 0.037289 0.020997 0.057154 0.012010 0.003406 0.000804 0.000158 0.000003 NAN 0.000010 0.000001 0.000000
0.000000 0.000489 0.006356 0.000457 0.000560 NAN 0.434344 0.002995 0.001435 0.000805 0.000110 0.000044 0.000019 0.000007 0.000004 0.000002 0.000009 0.000001 0.000000
0.000000 0.000065 0.023424 0.004072 0.000207 0.000111 0.000612 0.000737 0.000040 0.000016 0.000005 0.000004 0.000003 0.000002 0.000004 0.000040 0.000296 0.000001 0.000000
0.000000 0.000008 0.004669 0.002380 0.000060 0.000052 0.000035 0.000015 0.000003 0.000003 0.000001 0.000001 0.000002 0.000001 0.000004 0.000079 0.000203 0.000000 0.000000
0.000000 0.000004 0.001455 0.000794 0.000013 0.000008 0.000003 0.000002 0.000001 0.000002 0.000001 0.000001 0.000001 0.000001 0.000002 0.000025 0.000049 0.000000 0.000000
0.000000 0.000003 0.001851 0.000537 0.000005 0.000001 0.000001 0.000001 0.000001 0.000003 0.000001 0.000001 0.000001 0.000001 0.000003 0.000063 0.000120 0.000000 0.000000
0.000000 0.000006 0.007721 0.008900 0.000027 0.000002 0.000001 0.000002 0.000003 0.000165 0.000003 0.000001 0.000001 0.000002 0.000018 0.003111 0.001190 0.000001 0.000000
0.000000 0.000002 0.000779 0.000176 0.000003 0.000001 0.000000 0.000001 0.000001 0.000004 0.000001 0.000000 0.000000 0.000001 0.000002 0.000073 0.000082 0.000000 0.000000
0.000001 0.000001 0.002206 0.001344 0.000117 0.000027 0.000003 0.000001 0.000001 0.000001 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000001
0.000000 0.000003 0.002994 0.038473 0.082304 NAN 0.000025 0.000474 0.000127 0.000084 0.000018 0.000007 0.000004 0.000002 0.000005 0.000006 0.000005 0.000001 0.000000
0.000000 0.000094 0.028783 0.000477 NAN NAN 0.002694 0.049986 0.030050 0.054636 0.018708 0.004241 0.002596 0.001592 0.000032 0.000027 0.000154 0.000003 0.000000
0.000000 0.001099 0.000747 NAN 0.000036 NAN NAN 0.037293 0.020975 0.057129 0.012009 0.003407 0.000802 0.000157 0.000003 NAN 0.000010 0.000001 0.000000
0.000000 0.000488 0.006363 0.000456 0.000557 NAN 0.434341 0.002990 0.001431 0.000803 0.000110 0.000044 0.000019 0.000007 0.000004 0.000002 0.000009 0.000001 0.000000
0.000000 0.000064 0.023426 0.004075 0.000207 0.000111 0.000611 0.000734 0.000040 0.000016 0.000005 0.000004 0.000003 0.000002 0.000004 0.000040 0.000296 0.000001 0.000000
0.000000 0.000008 0.004667 0.002381 0.000060 0.000052 0.000035 0.000015 0.000003 0.000003 0.000001 0.000001 0.000001 0.000001 0.000004 0.000078 0.000203 0.000000 0.000000
0.000000 0.000004 0.001454 0.000794 0.000013 0.000008 0.000003 0.000002 0.000001 0.000002 0.000001 0.000001 0.000001 0.000001 0.000002 0.000025 0.000049 0.000000 0.000000
0.000000 0.000003 0.001850 0.000537 0.000005 0.000001 0.000001 0.000001 0.000001 0.000003 0.000001 0.000001 0.000001 0.000001 0.000003 0.000062 0.000120 0.000000 0.000000
0.000000 0.000006 0.007727 0.008913 0.000027 0.000002 0.000001 0.000002 0.000003 0.000165 0.000003 0.000001 0.000001 0.000002 0.000018 0.003112 0.001191 0.000001 0.000000
0.000000 0.000002 0.000778 0.000176 0.000003 0.000001 0.000000 0.000001 0.000001 0.000004 0.000001 0.000000 0.000000 0.000001 0.000002 0.000073 0.000082 0.000000 0.000000
0.000000 0.000001 0.000106 0.000027 0.000001 0.000001 0.000001 0.000001 0.000000 0.000001 0.000000 0.000000 0.000000 0.000001 0.000001 0.000024 0.000023 0.000001 0.000000
0.000000 0.000001 0.000462 0.000123 0.000003 0.000001 0.000001 0.000000 0.000000 0.000001 0.000000 0.000000 0.000001 0.000001 0.000002 0.000034 0.000056 0.000001 0.000000
0.000000 0.000006 0.010171 0.000907 0.000012 0.000003 0.000001 0.000000 0.000000 0.000001 0.000000 0.000000 0.000001 0.000001 0.000003 0.000023 0.000004 0.000001 0.000000
0.000000 0.000001 0.000461 0.000123 0.000003 0.000001 0.000001 0.000000 0.000000 0.000001 0.000000 0.000000 0.000001 0.000001 0.000002 0.000034 0.000056 0.000001 0.000000
0.000000 0.000006 0.010176 0.000908 0.000012 0.000003 0.000001 0.000000 0.000000 0.000001 0.000000 0.000000 0.000001 0.000001 0.000003 0.000023 0.000004 0.000001 0.000000
0.000000 0.000011 0.000302 0.000030 0.000027 0.000014 0.000002 0.000001 0.000001 0.000003 0.000001 0.000001 0.000002 0.000009 0.000020 0.000003 0.000002 0.000000 0.000000
0.000000 0.000074 0.000093 NAN 0.000019 0.000643 0.000082 0.000015 0.000029 0.000797 0.000052 0.000021 0.000077 0.001145 0.000509 0.000002 NAN 0.000000 0.000000
0.000000 0.000003 0.001183 0.000046 0.000192 0.006946 0.000201 0.000024 0.000061 0.000397 0.000111 0.000048 0.000128 0.002393 0.004157 0.000020 0.000001 0.000000 0.000000
0.000000 0.000074 0.000093 NAN 0.000019 0.000643 0.000082 0.000015 0.000029 0.000797 0.000052 0.000021 0.000077 0.001144 0.000508 0.000002 NAN 0.000000 0.000000
0.000000 0.000003 0.001183 0.000046 0.000192 0.006950 0.000201 0.000024 0.000061 0.000397 0.000111 0.000048 0.000128 0.002391 0.004162 0.000020 0.000001 0.000000 0.000000
0.000000 0.000001 0.000002 0.000036 0.000004 0.000005 0.000001 0.000001 0.000000 0.000000 0.000000 0.000000 0.000001 0.000002 0.000004 0.000002 0.000001 0.000001 0.000000
0.000001 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000001
policyPass 0.000000
Expand Down

0 comments on commit 18dfa77

Please sign in to comment.