"git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "1ad78fba619ab61e6720270ce65fdb6791b233c1"
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): ...@@ -116,6 +116,12 @@ class DiGraph(NN.Module):
''' '''
self.update_funcs.append((self._nodes_or_all(nodes), update_func, batched)) 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): def step(self):
# update message # update message
for ebunch, f, batched in self.message_funcs: 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