cpuct grows with the parent's visits #16

Merged
claude merged 1 commits from cpuct-scaling into main 2026-11-15 16:18:44 +01:00
2 changed files with 8 additions and 1 deletions

No files matched your search

+5 -1
View File
@@ -368,7 +368,11 @@ u32 Searcher::select_child(u32 idx) const {
}
const float fpu = parent_q - params.fpu_reduction * std::sqrt(visited_policy);
const float explore = params.cpuct * std::sqrt(float(std::max<u32>(node.visits, 1)));
// Exploration grows with the visits (Monty's scaling): a node searched a
// lot keeps giving its other children a chance.
const float n = float(std::max<u32>(node.visits, 1));
const float cpuct = params.cpuct * (1.0f + std::log((n + params.cpuct_visit_scale) / params.cpuct_visit_scale));
const float explore = cpuct * std::sqrt(n);
u32 best = node.first_child;
float best_score = -1e30f;
+3
View File
@@ -97,6 +97,9 @@ struct SearchLimits {
struct SearchParams {
float cpuct = 1.60f;
// cpuct is multiplied by 1 + ln((N + scale) / scale) for a node with N visits
// (Monty: 64 x 128).
float cpuct_visit_scale = 8192.0f;
float fpu_reduction = 0.30f;
float policy_temperature = 1.00f;
i64 move_overhead = 20;