-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Play move with the highest lower confidence bound #817
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ac776be
Play move with the highest lower confidence bound
Ttl 5bf3181
Don't play move with too few nodes
Ttl 35702d8
Update ci_alpha and min ratio parameters
Ttl 9644c7b
Correct squared diff calculation
Ttl e7c8752
fix windows build
borg323 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
This file is part of Leela Chess Zero. | ||
Copyright (C) 2019 The LCZero Authors | ||
|
||
Leela Chess is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
Leela Chess is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with Leela Chess. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
Additional permission under GNU GPL version 3 section 7 | ||
|
||
If you modify this Program, or any covered work, by linking or | ||
combining it with NVIDIA Corporation's libraries from the NVIDIA CUDA | ||
Toolkit and the NVIDIA CUDA Deep Neural Network library (or a | ||
modified version of those libraries), containing parts covered by the | ||
terms of the respective license agreement, the licensors of this | ||
Program grant you additional permission to convey the resulting work. | ||
*/ | ||
|
||
#include "stats.h" | ||
#include <boost/math/distributions/students_t.hpp> | ||
|
||
namespace lczero { | ||
|
||
namespace { | ||
auto constexpr kzEntries = 1000; | ||
std::array<float, kzEntries> kzLookup; | ||
} // namespace | ||
|
||
void CreatezTable(float ci_alpha) { | ||
for (auto i = 1; i < kzEntries + 1; i++) { | ||
boost::math::students_t dist(i); | ||
auto z = boost::math::quantile(boost::math::complement(dist, ci_alpha)); | ||
kzLookup[i - 1] = z; | ||
} | ||
} | ||
|
||
float CachedtQuantile(int v) { | ||
if (v < 1) { | ||
return kzLookup[0]; | ||
} | ||
if (v < kzEntries) { | ||
return kzLookup[v - 1]; | ||
} | ||
// z approaches constant when v is high enough. | ||
// With default lookup table size the function is flat enough that we | ||
// can just return the last entry for all v bigger than it. | ||
return kzLookup[kzEntries - 1]; | ||
} | ||
|
||
} // namespace lczero |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
This file is part of Leela Chess Zero. | ||
Copyright (C) 2019 The LCZero Authors | ||
|
||
Leela Chess is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
Leela Chess is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with Leela Chess. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
Additional permission under GNU GPL version 3 section 7 | ||
|
||
If you modify this Program, or any covered work, by linking or | ||
combining it with NVIDIA Corporation's libraries from the NVIDIA CUDA | ||
Toolkit and the NVIDIA CUDA Deep Neural Network library (or a | ||
modified version of those libraries), containing parts covered by the | ||
terms of the respective license agreement, the licensors of this | ||
Program grant you additional permission to convey the resulting work. | ||
*/ | ||
|
||
#pragma once | ||
|
||
namespace lczero { | ||
|
||
void CreatezTable(float ci_alpha); | ||
float CachedtQuantile(int v); | ||
|
||
} // namespace lczero |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this is the standard error (standard deviation divided by sqrt(N)). Maybe
stderr
is a better variable name.Or is this the standard deviation of something in another context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of the estimated distribution for the mean which has this standard deviation. Standard error seems to be correct too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, that seems logical, I didn't think about it that way :).