Last active
April 5, 2016 11:07
-
-
Save musically-ut/0d0271fe5281829fb853b8787f71c9e3 to your computer and use it in GitHub Desktop.
How to show an nnGraph plot in iTorch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'graph'; | |
require 'os'; | |
function displayGraph(g, forward) | |
local imgFile = os.tmpname() .. '.png' | |
local dag = g.fg | |
if forward == false then | |
dag = g.bg | |
end | |
graph.graphvizFile(dag, 'dot', imgFile) | |
itorch.image(image.load(imgFile)) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment