Skip to content

Instantly share code, notes, and snippets.

@musically-ut
Last active April 5, 2016 11:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save musically-ut/0d0271fe5281829fb853b8787f71c9e3 to your computer and use it in GitHub Desktop.
Save musically-ut/0d0271fe5281829fb853b8787f71c9e3 to your computer and use it in GitHub Desktop.
How to show an nnGraph plot in iTorch
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