X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=dagnn.git;a=blobdiff_plain;f=test-dagnn.lua;h=b390a29a5b7b412c6ff019e44f51ef5ef5e2a6de;hp=2db93c67adc784e8afd497279486eb46873b7aee;hb=d88688ee3e40d6087c8b0b271d257730c7ac76ca;hpb=a7a25093ee35439427cc2a085d63d0d22122e93c 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()