policy value

This commit is contained in:
Sander Land committed 2020-05-01 14:45:28 +02:00
1 parent 241d1c715e
commit 1b4fbb93f7
1 file changed
+4 -4
+4 -4
View File
@@ -110,10 +110,10 @@ class GameNode(SGFNode):
if sgf or hints or teach: if sgf or hints or teach:
policy_ranking = self.parent.policy_ranking policy_ranking = self.parent.policy_ranking
policy_ix = [ix + 1 for (p, m), ix in zip(policy_ranking, range(len(policy_ranking))) if m == single_move] currmove_policy_with_ix = [(ix + 1,p) for (p, m), ix in zip(policy_ranking, range(len(policy_ranking))) if m == single_move]
if policy_ix: if currmove_policy_with_ix:
text += f"Move was #{policy_ix[0]} according to policy.\n" text += f"Move was #{currmove_policy_with_ix[0][0]} according to policy ({currmove_policy_with_ix[0][1]:.2%}).\n"
if not policy_ix or policy_ix[0] != 1 and (sgf or hints): if not currmove_policy_with_ix or currmove_policy_with_ix[0] != 1 and (sgf or hints):
text += f"Top policy move was {policy_ranking[0][1].gtp()} ({policy_ranking[0][0]:.1%}).\n" text += f"Top policy move was {policy_ranking[0][1].gtp()} ({policy_ranking[0][0]:.1%}).\n"
if self.auto_undo and sgf: if self.auto_undo and sgf:
text += "Move was automatically undone in teaching mode." text += "Move was automatically undone in teaching mode."