MCPcopy Create free account
hub / github.com/BUPT-GAMMA/MASFactory / uct

Method uct

applications/lats/components/tree.py:26–33  ·  view source on GitHub ↗
(self, exploration_weight: float = 1.0)

Source from the content-addressed store, hash-verified

24 self.test_feedback = ""
25
26 def uct(self, exploration_weight: float = 1.0) -> float:
27 if self.visits == 0:
28 return self.value
29 p = self.parent
30 p_visits = p.visits if p else 1
31 return (self.value / self.visits) + exploration_weight * math.sqrt(
32 math.log(max(1, p_visits)) / self.visits
33 )
34
35 def best_child(self) -> "LATSNode | None":
36 if not self.children:

Callers 1

best_childMethod · 0.80

Calls 1

logMethod · 0.45

Tested by

no test coverage detected