Skip to content

Commit

Permalink
merge parameters of spsa tune
Browse files Browse the repository at this point in the history
  • Loading branch information
dhbloo committed Sep 23, 2024
1 parent 819b3c0 commit 04e2829
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
31 changes: 15 additions & 16 deletions Rapfi/search/mcts/parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,28 @@

namespace Search::MCTS {

constexpr float MaxNewVisitsProp = 0.2f;
constexpr float MaxNewVisitsProp = 0.275f;

constexpr float CpuctExploration = 1.0f;
constexpr float CpuctExplorationLog = 0.4f;
constexpr float CpuctExplorationBase = 500;
constexpr float CpuctExploration = 0.40f;
constexpr float CpuctExplorationLog = 0.75f;
constexpr float CpuctExplorationBase = 336;
constexpr float CpuctParentVisitBias = 0.1f;

constexpr float CpuctUtilityStdevScale = 0.0f;
constexpr float CpuctUtilityVarPrior = 0.16f;
constexpr float CpuctUtilityVarPriorWeight = 2.0f;
constexpr float CpuctUtilityStdevScale = 0.035f;
constexpr float CpuctUtilityVarPrior = 0.18f;
constexpr float CpuctUtilityVarPriorWeight = 2.14f;

constexpr float FpuReductionMax = 0.1f;
constexpr float FpuLossProp = 0.0f;
constexpr float RootFpuReductionMax = 0.05f;
constexpr float RootFpuLossProp = 0.0f;
constexpr float FpuUtilityBlendPow = 2.0f;
constexpr float FpuReductionMax = 0.075f;
constexpr float FpuLossProp = 0.001f;
constexpr float RootFpuReductionMax = 0.075f;
constexpr float RootFpuLossProp = 0.0036f;
constexpr float FpuUtilityBlendPow = 1.73f;

constexpr uint32_t MinTranspositionSkipVisits = 10;
constexpr uint32_t MinTranspositionSkipVisits = 12;

constexpr bool UseLCBForBestmoveSelection = true;
constexpr float LCBStdevs =
4.265f; // quantile of student's t dist(n) at confidence level 1-1e-5 as n -> inf
constexpr float LCBMinVisitProp = 0.15f;
constexpr float LCBStdevs = 5.0f;
constexpr float LCBMinVisitProp = 0.12f;

constexpr float PolicyTemperature = 1.0f;

Expand Down
2 changes: 1 addition & 1 deletion Rapfi/search/mcts/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ inline float cpuctExplorationFactor(uint32_t parentVisits)
float cpuct = CpuctExploration;
if (CpuctExplorationLog != 0)
cpuct += CpuctExplorationLog * std::log(1.0f + parentVisits / CpuctExplorationBase);
return cpuct * std::sqrt(parentVisits + CpuctParentVisitBias);
return cpuct * std::sqrt(parentVisits + 1e-2f);
}

/// Compute the initial utility value for unexplored children, considering first play urgency.
Expand Down

0 comments on commit 04e2829

Please sign in to comment.