major bug fix
This commit is contained in:
1 parent
f31899f4a3
commit
2eb558874f
4 files changed
+6
-5
No files matched your search
@@ -62,10 +62,10 @@ def ai_move(game: Game, ai_mode: str, ai_settings: Dict) -> Tuple[Move, GameNode
|
||||
lower_bound = max(0, ai_settings["lower_bound"])
|
||||
weaken_fac = max(0.01, ai_settings["weaken_fac"])
|
||||
weighted_coords = [(policy_grid[y][x], policy_grid[y][x] ** (1 / weaken_fac), x, y) for x in range(size[0]) for y in range(size[1]) if policy_grid[y][x] > lower_bound]
|
||||
if top_5_pass or pass_policy > lower_bound:
|
||||
if top_5_pass:
|
||||
weighted_coords.append([pass_policy, pass_policy ** (1 / weaken_fac), None, None])
|
||||
top = weighted_selection_without_replacement(weighted_coords, 1)
|
||||
if top and top[0][2]:
|
||||
if top and top[0][2] is not None:
|
||||
best = top[0]
|
||||
policy_value = best[0]
|
||||
coords = best[2:]
|
||||
|
||||
+2
-2
@@ -125,8 +125,8 @@
|
||||
"_help_left": "Increase `line_weight` to penalize moves closer to the center more."
|
||||
},
|
||||
"<Pause>": {
|
||||
"_help_right": "",
|
||||
"_help_left": ""
|
||||
"_help_right": "--Edward Lasker",
|
||||
"_help_left": "The rules of go are so elegant, organic, and rigorously logical that if intelligent life forms exist elsewhere in the universe, they almost certainly play go."
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ ENGINE_SETTINGS = {
|
||||
"max_visits": 50,
|
||||
"max_time": 1.0,
|
||||
"enable_ownership": False,
|
||||
"threads": 4,
|
||||
"threads": 8,
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -194,6 +194,7 @@ class BadukPanWidget(Widget):
|
||||
move_eval_on = show_dots_for.get(m.player) and (i < show_n_eval or full_eval_on)
|
||||
if move_eval_on and points_lost is not None:
|
||||
evalcol = self.eval_color(points_lost)
|
||||
print(evalcol)
|
||||
else:
|
||||
evalcol = None
|
||||
inner = stone_color[m.opponent] if i == 0 else None
|
||||
|
||||
Reference in new issue
Block a user