Date: Nov 15, 2013 11:30 AM
Author: chaudhry
Subject: how to load save neural net

hi, iam trying to save my net, it saves in this way but how can i load it.....

after closing matlab then i want to open in a way that just i load this net and then give sim(net,w) command and it will give me results

whats the command for that







inputs =[inp];

targets =[g];

% Create a Fitting Network
hiddenLayerSize = 15;
net = fitnet(hiddenLayerSize);

% % Choose Input and Output Pre/Post-Processing Functions
% % For a list of all processing functions type: help nnprocess
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
net.outputs{2}.processFcns = {'removeconstantrows','mapminmax'};


% Setup Division of Data for Training, Validation, Testing
% For a list of all data division functions type: help nndivide
net.divideFcn = 'dividerand'; % Divide data randomly
net.divideMode = 'sample'; % Divide up every sample
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;

% For help on training function 'trainlm' type: help trainlm
% For a list of all training functions type: help nntrain
net.trainFcn = 'trainlm'; % Levenberg-Marquardt

% Choose a Performance Function
% For a list of all performance functions type: help nnperformance
net.performFcn = 'mse'; % Mean squared error

% Choose Plot Functions
% For a list of all plot functions type: help nnplot
net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ...
'plotregression', 'plotfit'};


% Train the Network
[net,tr] = train(net,inputs,targets);

save('neural_net', 'net', '-mat');