MCPcopy Create free account
hub / github.com/MARIO-Math-Reasoning/Super_MARIO / puct

Method puct

mcts_math/nodes/mcts_node.py:47–50  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

45 self.parent.update_recursive(value, start_node)
46
47 def puct(self) -> float:
48 q_value = self.q_value() if self.visit_count() > 0 else 0
49 u_value = self.c_puct * self.prior * np.sqrt(self.parent.visit_count()) / (1 + self.visit_count())
50 return q_value + u_value
51

Callers 1

select_childMethod · 0.45

Calls 2

q_valueMethod · 0.95
visit_countMethod · 0.95

Tested by

no test coverage detected