projects
/
dagnn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Now prints the input index when a node gets multiple input.
[dagnn.git]
/
dagnn.lua
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