Torch / Lua, how to save a trained neural network

2019-04-05 23:42发布

I working on a Torch / Lua project, in which I implemented an artificial neural network model. Everything works, but now I'd like to modify my code in the following way. Since my input dataset are very large, I'd like to divide it in N=20 spans.

Then I want to train my neural network only on the 1st dataset span and then test on the other N-1=19 spans in parallel.

To run all these parallel jobs, I need to save up my neural network model details to a file, and then load it for every 19 jobs.

Is there any way in torch to correctly "write" an artificial neural network model to file?

1条回答
做自己的国王
2楼-- · 2019-04-06 00:43
-- save the model
torch.save(filename, model)

.

-- load the model
model = torch.load(filename)
查看更多
登录 后发表回答