Skip to content

Commit 93ce9ef

Browse files
authored
Merge pull request #89 from kobanium/develop
Remove unused white space from pv string.
2 parents d4fbe56 + 3606c22 commit 93ce9ef

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

mcts/node.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def get_analysis(self, board: GoBoard, mode: str, \
391391
prior = self.children_policy[i]
392392

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

396396
children_status_list.append(
397397
{
@@ -423,11 +423,13 @@ def get_analysis(self, board: GoBoard, mode: str, \
423423
out += f"lcb {int(10000 * status['lcb'])} "
424424
out += f"order {status['order']} "
425425
out += f"pv {status['pv']}"
426+
out += " "
426427
elif mode == "cgos":
427428
cgos_dict["moves"].append(status)
428429

429430
if mode == "cgos":
430431
out = json.dumps(cgos_dict, indent=None, separators=(',', ':'))
431-
432+
else:
433+
out = out[:-1]
432434
out += '\n'
433435
return out

mcts/pucb/pucb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def calculate_pucb_value(node_visits: int, children_visits: np.ndarray, \
1212
Args:
1313
node_visits (int): ノードの探索回数。
1414
children_visits (np.ndarray): 子ノードの探索回数。
15-
value (np.ndarray): 子ノードのValueの合計値。
15+
value_sum (np.ndarray): 子ノードのValueの合計値。
1616
policy (np.ndarray): 子ノードのPolicy。
1717
1818
Returns:

program.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@
2929
# 強化学習の棋譜生成時に経過情報の表示を追加。
3030
# Version 0.9.0 : undo, fixed_handicapコマンド、コマンドID付きGTPコマンドのサポート。
3131
# 不正なGTPコマンドの応答誤りを修正。
32-
VERSION="0.9.0"
32+
# Version 0.9.1 : PVに空文字が混入する不具合の修正。
33+
VERSION="0.9.1"

0 commit comments

Comments
 (0)