Compare commits
1
Commits
d39b8a3a4a
...
b89ab39bdd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b89ab39bdd |
No files matched your search
@@ -79,6 +79,7 @@ terminal).
|
|||||||
| Threads | 1 | Only 1 for now. |
|
| Threads | 1 | Only 1 for now. |
|
||||||
| MoveOverhead | 20 | Milliseconds kept back per move. |
|
| MoveOverhead | 20 | Milliseconds kept back per move. |
|
||||||
| CPuct | 160 | Exploration constant x100. |
|
| CPuct | 160 | Exploration constant x100. |
|
||||||
|
| RootCPuct | 233 | Exploration constant at the root x100. |
|
||||||
| FPUReduction | 30 | First-play urgency reduction x100. |
|
| FPUReduction | 30 | First-play urgency reduction x100. |
|
||||||
| PolicyTemp | 100 | Policy softmax temperature x100. |
|
| PolicyTemp | 100 | Policy softmax temperature x100. |
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -371,7 +371,9 @@ u32 Searcher::select_child(u32 idx) const {
|
|||||||
// Exploration grows with the visits (Monty's scaling): a node searched a
|
// Exploration grows with the visits (Monty's scaling): a node searched a
|
||||||
// lot keeps giving its other children a chance.
|
// lot keeps giving its other children a chance.
|
||||||
const float n = float(std::max<u32>(node.visits, 1));
|
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));
|
// The root, where the move is chosen, explores more.
|
||||||
|
const float base_cpuct = idx == Tree::root() ? params.root_cpuct : params.cpuct;
|
||||||
|
const float cpuct = base_cpuct * (1.0f + std::log((n + params.cpuct_visit_scale) / params.cpuct_visit_scale));
|
||||||
const float explore = cpuct * std::sqrt(n);
|
const float explore = cpuct * std::sqrt(n);
|
||||||
|
|
||||||
u32 best = node.first_child;
|
u32 best = node.first_child;
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ struct SearchLimits {
|
|||||||
|
|
||||||
struct SearchParams {
|
struct SearchParams {
|
||||||
float cpuct = 1.60f;
|
float cpuct = 1.60f;
|
||||||
|
// At the root: cpuct x 1.458, Monty's root_cpuct / cpuct (0.4119 / 0.2826).
|
||||||
|
float root_cpuct = 2.33f;
|
||||||
// cpuct is multiplied by 1 + ln((N + scale) / scale) for a node with N visits
|
// cpuct is multiplied by 1 + ln((N + scale) / scale) for a node with N visits
|
||||||
// (Monty: 64 x 128).
|
// (Monty: 64 x 128).
|
||||||
float cpuct_visit_scale = 8192.0f;
|
float cpuct_visit_scale = 8192.0f;
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ void print_id() {
|
|||||||
send("option name MoveOverhead type spin default 20 min 0 max 5000");
|
send("option name MoveOverhead type spin default 20 min 0 max 5000");
|
||||||
// Search constants, exposed as integers (x100) so SPSA can tune them.
|
// Search constants, exposed as integers (x100) so SPSA can tune them.
|
||||||
send("option name CPuct type spin default 160 min 1 max 1000");
|
send("option name CPuct type spin default 160 min 1 max 1000");
|
||||||
|
send("option name RootCPuct type spin default 233 min 1 max 1000");
|
||||||
send("option name FPUReduction type spin default 30 min 0 max 200");
|
send("option name FPUReduction type spin default 30 min 0 max 200");
|
||||||
send("option name PolicyTemp type spin default 100 min 10 max 500");
|
send("option name PolicyTemp type spin default 100 min 10 max 500");
|
||||||
send("uciok");
|
send("uciok");
|
||||||
@@ -85,6 +86,8 @@ void set_option(Engine& e, std::istringstream& is) {
|
|||||||
e.searcher.params.move_overhead = std::clamp(v, 0, 5000);
|
e.searcher.params.move_overhead = std::clamp(v, 0, 5000);
|
||||||
else if (lname == "cpuct")
|
else if (lname == "cpuct")
|
||||||
e.searcher.params.cpuct = float(v) / 100.0f;
|
e.searcher.params.cpuct = float(v) / 100.0f;
|
||||||
|
else if (lname == "rootcpuct")
|
||||||
|
e.searcher.params.root_cpuct = float(v) / 100.0f;
|
||||||
else if (lname == "fpureduction")
|
else if (lname == "fpureduction")
|
||||||
e.searcher.params.fpu_reduction = float(v) / 100.0f;
|
e.searcher.params.fpu_reduction = float(v) / 100.0f;
|
||||||
else if (lname == "policytemp")
|
else if (lname == "policytemp")
|
||||||
|
|||||||
Reference in new issue
Block a user