Commit ca0622b2 authored by zzhang-cn's avatar zzhang-cn
Browse files

add visualization of the tree

parent 40c698dd
......@@ -116,6 +116,12 @@ class DiGraph(NN.Module):
'''
self.update_funcs.append((self._nodes_or_all(nodes), update_func, batched))
def draw(self):
from networkx.drawing.nx_agraph import graphviz_layout
pos = graphviz_layout(self.G, prog='dot')
nx.draw(self.G, pos, with_labels=True)
def step(self):
# update message
for ebunch, f, batched in self.message_funcs:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment