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()
-- 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()