From: Francois Fleuret Date: Fri, 3 Feb 2017 19:53:51 +0000 (+0100) Subject: Added graph.pdf generated from graph.dot. X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=dagnn.git;a=commitdiff_plain;h=d88688ee3e40d6087c8b0b271d257730c7ac76ca Added graph.pdf generated from graph.dot. --- diff --git a/graph.pdf b/graph.pdf new file mode 100644 index 0000000..f4aa139 Binary files /dev/null and b/graph.pdf differ diff --git a/test-dagnn.lua b/test-dagnn.lua index 2db93c6..b390a29 100755 --- a/test-dagnn.lua +++ b/test-dagnn.lua @@ -104,9 +104,12 @@ dag:setLabel(a, 'first module') dag:setInput(a) dag:setOutput({ d, e }) --- Check the output of the dot file -print('Writing /tmp/graph.dot') -dag:saveDot('/tmp/graph.dot') +-- Check the output of the dot file. Generate a pdf with: +-- +-- dot ./graph.dot -Lg -T pdf -o ./graph.pdf +-- +print('Writing ./graph.dot') +dag:saveDot('./graph.dot') -- Let's make a model where the dag is inside another nn.Container. model = nn.Sequential() @@ -133,8 +136,8 @@ print('Gradient estimate error ' .. checkGrad(model, criterion, input, output, e -- Check that we can save and reload the model model:clearState() -torch.save('/tmp/test.t7', model) -local otherModel = torch.load('/tmp/test.t7') +torch.save('./test.t7', model) +local otherModel = torch.load('./test.t7') print('Gradient estimate error ' .. checkGrad(otherModel, criterion, input, output, epsilon)) dag:print()