projects
/
dagnn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d8fd868
)
Now prints the input index when a node gets multiple input.
author
Francois Fleuret
<francois@fleuret.org>
Fri, 13 Jan 2017 08:08:55 +0000
(09:08 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Fri, 13 Jan 2017 08:08:55 +0000
(09:08 +0100)
dagnn.lua
patch
|
blob
|
history
diff --git
a/dagnn.lua
b/dagnn.lua
index
ca51841
..
c17347d
100755
(executable)
--- a/
dagnn.lua
+++ b/
dagnn.lua
@@
-167,20
+167,25
@@
function DAG:saveDot(filename)
file:write('\n')
file:write('\n')
- for nnm
a
, node in pairs(self.node) do
+ for nnm
b
, node in pairs(self.node) do
file:write(
' '
.. node.index
file:write(
' '
.. node.index
- .. ' [shape=box,label=\"' .. torch.type(nnm
a
) .. '\"]'
+ .. ' [shape=box,label=\"' .. torch.type(nnm
b
) .. '\"]'
.. '\n'
)
.. '\n'
)
- for _, nnmb in pairs(node.succ) do
+ for i, nnma in pairs(node.pred) do
+ local decoration = ''
+ if #node.pred > 1 then
+ decoration = ' [label=\"' .. i .. '\"]'
+ end
file:write(
' '
file:write(
' '
- ..
node
.index
+ ..
self.node[nnma]
.index
.. ' -> '
.. self.node[nnmb].index
.. ' -> '
.. self.node[nnmb].index
+ .. decoration
.. '\n'
)
end
.. '\n'
)
end