Skip to content
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

Use Q=0 for self-play following AZ paper behavior while keeping FPU reduction tuning #350

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/mcts/search.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ int64_t Search::GetTimeSinceStart() const {
}

void Search::SendMovesStats() const {
const float parent_q =
const float parent_q = kNoise ? 0.0f :
-root_node_->GetQ() -
kFpuReduction * std::sqrt(root_node_->GetVisitedPolicy());
const float U_coeff =
Expand Down Expand Up @@ -712,9 +712,12 @@ SearchWorker::NodeToProcess SearchWorker::PickNodeToExtend() {
search_->kCpuct * std::sqrt(std::max(node->GetChildrenVisits(), 1u));
float best = -100.0f;
int possible_moves = 0;
// Initialize Q=0 for self-play games played with noise following AZ paper's
// behavior of searching wider for losing positions and deeper for winning
// positions. Allow tuning first play urgency of parentQ to optimize search.
float parent_q =
((is_root_node && search_->kNoise) || !search_->kFpuReduction)
? -node->GetQ()
is_root_node && search_->kNoise
? 0.0f
: -node->GetQ() -
search_->kFpuReduction * std::sqrt(node->GetVisitedPolicy());
for (auto child : node->Edges()) {
Expand Down