Skip to content

Commit

Permalink
chore: switch to softmax for normalizing policy
Browse files Browse the repository at this point in the history
H1 Accepted
╔═════════════════════════════════════════════════╗
║ ELO   | 99.48 +- 24.24 (95%)                    ║
║ LLR   | 2.95 (-2.94, 2.94) [0.00, 5.00]         ║
║ GAMES | N: 820 W: 523 L: 294 D: 3               ║
║ PENTA | [48, 1, 197, 2, 162]                    ║
╚═════════════════════════════════════════════════╝
  • Loading branch information
raklaptudirm committed Jun 5, 2024
1 parent b06a314 commit 55af3e8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/mcts/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ impl Node {
let mut sum = 0.0;
let mut policies = vec![];
for edge in self.edges.iter() {
let policy = policy(self, edge.mov).max(0.0);
let square = policy;
policies.push(square);
sum += square;
let policy = policy(self, edge.mov).exp();
policies.push(policy);
sum += policy;
}

for (i, edge) in self.edges.iter_mut().enumerate() {
Expand Down

0 comments on commit 55af3e8

Please sign in to comment.