Search Tree Viz
NonArchimedeanMachineLearning.visualize_search_tree — Method
visualize_search_tree(root_or_state; max_depth=10, max_nodes=10000, init_expand=3, kwargs...)Create an interactive D3Tree visualization from any NonArchimedeanMachineLearning tree search node or state.
Arguments
root_or_state: Any search tree node (MCTSNode, UCTNode, etc.), state (MCTSState, etc.), or OptimSetup with a tree search state.max_depth::Int=10: Maximum tree depth to include.max_nodes::Int=10000: Maximum number of nodes to include.init_expand::Int=3: Number of levels expanded initially in the visualization.title::String: Title for the visualization (auto-generated from node type if omitted).svg_height::Int=800: Height of the SVG in pixels.- Additional keyword arguments are forwarded to
D3Tree.
Returns
A D3Tree object. Displays interactively in Jupyter/VSCode, or use inbrowser(tree).
Examples
# After running MCTS optimization
optim = mcts_descent_init(param, loss, config)
for i in 1:50; step!(optim); end
tree = visualize_search_tree(optim)
# or: tree = visualize_search_tree(optim.state)
# or: tree = visualize_search_tree(optim.state.root)