Asked by Sree Srinivasan
on 9 Nov 2012

For applications that do not require real-time predictions, the user may tolerate Matlab ANN runs that seem to take forever. Case in point: With about 300 variables (or descriptors), 2000 data points, 5 different variations of neurons in the hidden layer (5 to 25 in increments of 5),3 re-initializations (to avoid local minima), but no division into training & validation sets (unnecessary with Bayes regularization), trainbr (1 hidden layer) takes about a week (on a Windows 7 laptop with 4GB RAM, running the 64 bit version of Matlab).

The run also includes, for comparison, trainings based on 30 linear or nonlinear principal components or selected descriptors instead of the 300 raw descriptors. So, asking me to explore "dimension reduction" is not the answer.

It would be nice to save the network (weights, etc.) trained at such an expense of time, so that it can be evaluated on test data that may become available in the future, without having to spend a week training the network everytime a new set of test data becomes available.

*No products are associated with this question.*

Answer by Greg Heath
on 14 Nov 2012

Accepted answer

save net01

When you need it later

load net01

Voila!

Sree Srinivasan
on 17 Nov 2012

That works, but when assigning a file name within the batch run (not interactively), there is a problem:

Net_Iter = {['Net', Run_Index, '.mat' ]}

save Net_Iter net

Run_Index is a number that varies within a FOR loop (where several networks are trained one after another).

Net_Iter = 'Net123.mat'

But the save command results in Net_iter.mat (literally!).

Answer by Sean de Wolski
on 9 Nov 2012

Can't you just save it?

Greg Heath
on 13 Nov 2012

I agree. Save the whole net instead of saving parameters and weights separately.

Sree Srinivasan
on 14 Nov 2012

Thanks. So, the following commands should work. Am I right?

To save: save net1.mat net

To use later: load net1.mat net

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 0 Comments