Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCTSツリーの描画機能 #94

Closed
kaorahi opened this issue Jan 10, 2024 · 2 comments
Closed

MCTSツリーの描画機能 #94

kaorahi opened this issue Jan 10, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@kaorahi
Copy link
Contributor

kaorahi commented Jan 10, 2024

#91 を参照 (やっつけ試作あり). 実装は清書中.

kaorahi added a commit to kaorahi/TamaGo that referenced this issue Jan 10, 2024
kobanium added a commit that referenced this issue Jan 10, 2024
@kobanium kobanium added the enhancement New feature or request label Jan 10, 2024
@kaorahi
Copy link
Contributor Author

kaorahi commented Jan 12, 2024

探索順をエッジの色にするのはいかがでしょう. 見にくいでしょうか?

tree_graph

--- a/graph/plot_tree.py
+++ b/graph/plot_tree.py
@@ -99,8 +99,12 @@ def plot_tree_main(input_json_path: str, output_image_path: str, around_pv: bool
         )
 
         # エッジの作成
+        oldness = 1 - (item['index'] + 1) / len(node)
+        whiteness = 0.9
+        c = f"{int(oldness * whiteness * 255):02x}"
+        color = f"#{c}{c}{c}"
         penwidth = max(0.5, item['policy'] * 10)
-        dot.edge(str(parent_index), str(index), penwidth=f"{penwidth}")
+        dot.edge(str(parent_index), str(index), color=color, penwidth=f"{penwidth}")
 
     dot.render(output_image_path, format='png', view=False, cleanup=True)
 

@kobanium
Copy link
Owner

認識が間違っていたら申し訳ないのですが、色が濃いほど最近に展開されたノードで、薄いほど探索の初期に展開されたノードって言うことですかね。
色の濃さが逆の方が何となく直感(Policy)で選ばれる本流はこれっていうのがわかりやすいと感じました。
ただエッジの濃淡で意味をもたせるのは情報量が増えますし、表示の仕方とその意味がわかれば十分に理解できるので素晴らしいアイデアだと思います。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants