-
Notifications
You must be signed in to change notification settings - Fork 535
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
Transform Q into logit space when determining Q+U best child #925
Merged
Conversation
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
efficient propagation of certainty, two-fold draw scoring, mate display and more. =1 suitable for training =2 for play Currently negabound search depth is one. Improves play in positions with many certain positions (nrear endgame TBs, mates). Sees repetitions faster and scores positions more accurately.
…ersion. Increasing threads (e.g. 4 or 6) will get to masters speed now. Further speed fixes (move generator) possible....
…with lto, this yields a speed up by 30-50% in backend=random. In order to fully use CP please use 4 threads+. Changed default temporarily to 4 threads with this commit, to collect more scaling data.
…ds instant play of certain winning moves and avoidance of loosing moves regardless of visits. CP=3 now adds advanced pruning.
- exposed depth parameter (0 is no-look-ahead) - only two modes CP=1 for training and CP=2 for play Todo: - change option from int to choiceoption - use info.mate to communicate mate scores
- Certainty Propagation is a bool option now, just on or off (default = off). - Cleanup code and comments - Threads default = 2, but if certainty propagation is turned on please use 4 threads.
…r certain losses over terminal losses.
Tilps
reviewed
Sep 12, 2019
Could you check nps with random backend
e.g. with UPD: did that myself:
which is a bit suspicious that it became faster. :) UPD2: |
mooskagh
reviewed
Sep 13, 2019
mooskagh
reviewed
Sep 13, 2019
mooskagh
approved these changes
Sep 14, 2019
3 tasks
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Edit:
The idea here is that when Q is near +1 or -1, the U term dominates the search since a small change in Q corresponds to a large change in the chance of winning/losing.
This PR transforms Q into logit space (logit is the function that converts log-odd to probability) before adding the U term.
In sumary, instead of
Q + U
, I uselogit(Q) + U
.See also @Naphthalin's explanation on Discord
An example at extreme Q (PR925 on bottom):
4Rbk1/5p2/p2Q2p1/7p/6N1/2p4P/PP3PPK/8 w - - 0 1
Original:
Scaling factor for
U
term:2 * Q / ln( (1 + Q) / (1 - Q) )
Graph from Desmos
Cpuct probably needs to be re-tuned along with this change.
It may or may not make more sense to use the root/parent Q value instead.