diff --git a/src/mcts.rs b/src/mcts.rs index 25e0cc22..3c8825ed 100644 --- a/src/mcts.rs +++ b/src/mcts.rs @@ -373,7 +373,12 @@ impl<'a> Searcher<'a> { let mut q = SearchHelpers::get_action_value(action, fpu); if !action.ptr().is_null() { - q -= self.params.virtual_loss() * f32::from(self.tree[action.ptr()].threads()); + let threads = f64::from(self.tree[action.ptr()].threads()); + if threads > 0.0 { + let visits = f64::from(action.visits()); + let q2 = f64::from(q) * visits / (visits + threads); + q = q2 as f32; + } } let u = expl * action.policy() / (1 + action.visits()) as f32; diff --git a/src/mcts/params.rs b/src/mcts/params.rs index d804b37b..7b2c7d7b 100644 --- a/src/mcts/params.rs +++ b/src/mcts/params.rs @@ -130,7 +130,6 @@ macro_rules! make_mcts_params { } make_mcts_params! { - virtual_loss: f32 = 0.5, 0.0, 1.0, 0.01, 0.002; root_pst: f32 = 3.64, 1.0, 10.0, 0.4, 0.002; root_cpuct: f32 = 0.314, 0.1, 5.0, 0.065, 0.002; cpuct: f32 = 0.314, 0.1, 5.0, 0.065, 0.002;