Skip to content

Commit

Permalink
Merge pull request #89 from kobanium/develop
Browse files Browse the repository at this point in the history
Remove unused white space from pv string.
  • Loading branch information
kobanium committed Jan 1, 2024
2 parents d4fbe56 + 3606c22 commit 93ce9ef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions mcts/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def get_analysis(self, board: GoBoard, mode: str, \
prior = self.children_policy[i]

pv_list = pv_lists[coordinate.convert_to_gtp_format(pos)]
pv_str = "".join([f"{p} " for p in pv_list])
pv_str = " ".join([f"{p}" for p in pv_list])

children_status_list.append(
{
Expand Down Expand Up @@ -423,11 +423,13 @@ def get_analysis(self, board: GoBoard, mode: str, \
out += f"lcb {int(10000 * status['lcb'])} "
out += f"order {status['order']} "
out += f"pv {status['pv']}"
out += " "
elif mode == "cgos":
cgos_dict["moves"].append(status)

if mode == "cgos":
out = json.dumps(cgos_dict, indent=None, separators=(',', ':'))

else:
out = out[:-1]
out += '\n'
return out
2 changes: 1 addition & 1 deletion mcts/pucb/pucb.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def calculate_pucb_value(node_visits: int, children_visits: np.ndarray, \
Args:
node_visits (int): ノードの探索回数。
children_visits (np.ndarray): 子ノードの探索回数。
value (np.ndarray): 子ノードのValueの合計値。
value_sum (np.ndarray): 子ノードのValueの合計値。
policy (np.ndarray): 子ノードのPolicy。
Returns:
Expand Down
3 changes: 2 additions & 1 deletion program.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@
# 強化学習の棋譜生成時に経過情報の表示を追加。
# Version 0.9.0 : undo, fixed_handicapコマンド、コマンドID付きGTPコマンドのサポート。
# 不正なGTPコマンドの応答誤りを修正。
VERSION="0.9.0"
# Version 0.9.1 : PVに空文字が混入する不具合の修正。
VERSION="0.9.1"

0 comments on commit 93ce9ef

Please sign in to comment.