Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: how to load save neural net
Replies: 1   Last Post: Nov 15, 2013 6:25 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Greg Heath

Posts: 5,919
Registered: 12/7/04
Re: how to load save neural net
Posted: Nov 15, 2013 6:25 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"chaudhry " <bilal_zafar9@yahoo.com> wrote in message <l65i7c$plk$1@newscl01ah.mathworks.com>...
> 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');


help load

load neural_net



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.