fewer hints, alternatives search

This commit is contained in:
Sander Land committed 2020-09-08 22:26:14 +02:00
1 parent 2758e936c8
commit 4e2ee03db7
26 files changed
+137 -47

No files matched your search

+17 -7
View File
@@ -361,7 +361,7 @@ class BadukPanWidget(Widget):
polsize = 1.1 * math.sqrt(policy_grid[y][x])
policy_circle_color = (
*POLICY_COLOR,
POLICY_ALPHA + TOP_MOVE_ALPHA * (policy_grid[y][x] == best_move_policy),
POLICY_ALPHA + TOP_POLICY_ALPHA * (policy_grid[y][x] == best_move_policy),
)
draw_circle(
(self.gridpos_x[x], self.gridpos_y[y]), polsize * self.stone_size, policy_circle_color
@@ -409,27 +409,37 @@ class BadukPanWidget(Widget):
self.active_pv_moves = []
# hints or PV
if katrain.analysis_controls.hints.active and not katrain.analysis_controls.policy.active and not game_ended:
if (
katrain.analysis_controls.hints.active
and not katrain.analysis_controls.policy.active
and not game_ended
):
hint_moves = current_node.candidate_moves
for i, move_dict in enumerate(hint_moves):
move = Move.from_gtp(move_dict["move"])
if move.coords is not None:
scale = 0.95
if move_dict["visits"] < VISITS_FRAC_SMALL * hint_moves[0]["visits"]:
scale = 0.75
scale = HINT_SCALE
text_on = True
alpha = HINTS_ALPHA
if move_dict["visits"] < katrain.config("engine/fast_visits"):
scale = UNCERTAIN_HINT_SCALE
text_on = False
alpha = HINTS_MIN_ALPHA + (HINTS_ALPHA - HINTS_MIN_ALPHA) * (
move_dict["visits"] / katrain.config("engine/fast_visits")
)
if "pv" in move_dict:
self.active_pv_moves.append((move.coords, move_dict["pv"], current_node))
else:
katrain.log(f"PV missing for move_dict {move_dict}", OUTPUT_DEBUG)
evalsize = self.stone_size * scale
evalcol = self.eval_color(move_dict["pointsLost"])
Color(*evalcol[:3], HINTS_ALPHA)
Color(*evalcol[:3], alpha)
Rectangle(
pos=(self.gridpos_x[move.coords[0]] - evalsize, self.gridpos_y[move.coords[1]] - evalsize),
size=(2 * evalsize, 2 * evalsize),
source="katrain/img/topmove.png",
)
if self.trainer_config["text_point_loss"]:
if self.trainer_config["text_point_loss"] and text_on:
if move_dict["pointsLost"] < 0.05:
ptloss_text = "0.0"
else:
+1
View File
@@ -373,6 +373,7 @@ class AnalysisToggle(MDBoxLayout):
default_active = BooleanProperty(False)
font_name = StringProperty(DEFAULT_FONT)
disabled = BooleanProperty(False)
def trigger_action(self, *args, **kwargs):
return self.checkbox.trigger_action(*args, **kwargs)
+7 -4
View File
@@ -59,13 +59,16 @@ POLICY_COLOR = [0.9, 0.2, 0.8]
STARPOINT_SIZE = 0.1
BOARD_COLOR = [0.85, 0.68, 0.40, 1]
STONE_SIZE = 0.505 # texture edge is transparent
VISITS_FRAC_SMALL = 0.1
POLICY_ALPHA = 0.5
HINTS_ALPHA = 0.75
TOP_MOVE_ALPHA = 0.4
HINTS_ALPHA = 0.8
HINTS_MIN_ALPHA = 0.1 # single visit
POLICY_ALPHA = 0.6
TOP_POLICY_ALPHA = 0.3
TOP_MOVE_BORDER_COLOR = [10 / 255, 200 / 255, 250 / 255, 1.0]
CHILD_SCALE = 0.95
HINT_SCALE = 0.975
UNCERTAIN_HINT_SCALE = 0.7
# ponder light
ENGINE_DOWN_COL = EVAL_COLORS["theme:normal"][1]