how to save the trained network in nftool and how to reuse the saved network to do the prediction by using predict command with new inputs(same number of element but larger sample size)?
3 ビュー (過去 30 日間)
古いコメントを表示
Actually i'm using the nftool to train 10959x5 as inputs and 10958x1 as target after i trained the network,below is the script of my network:
% Solve an Input-Output Fitting problem with a Neural Network % Script generated by Neural Fitting app % Created 07-Mar-2016 15:43:04 % % This script assumes these variables are defined: % % inputs - input data. % target - target data.
x = inputs'; t = target';
% Choose a Training Function % For a list of all training functions type: help nntrain % 'trainlm' is usually fastest. % 'trainbr' takes longer but may be better for challenging problems. % 'trainscg' uses less memory. Suitable in low memory situations. trainFcn = 'trainlm'; % Levenberg-Marquardt backpropagation.
% Create a Fitting Network hiddenLayerSize = 60; net = fitnet(hiddenLayerSize,trainFcn);
% Setup Division of Data for Training, Validation, Testing net.divideParam.trainRatio = 60/100; net.divideParam.valRatio = 20/100; net.divideParam.testRatio = 20/100;
% Train the Network [net,tr] = train(net,x,t);
% Test the Network y = net(x); e = gsubtract(t,y); performance = perform(net,t,y)
% View the Network view(net)
% Plots % Uncomment these lines to enable various plots. %figure, plotperform(tr) %figure, plottrainstate(tr) %figure, ploterrhist(e) %figure, plotregression(t,y) %figure, plotfit(net,x,t)
if i want to keep the same results of this network and use this trained network to predict the results by using new inputs, what should i do with 'predict' this code. should i save the network in net?as it will appear in workspace as 1 x 1 network, but inside there doesnt has any value
I found many answer in online,they save just save the network as net and use predict(net,newinputs) will do, but below is the error showed when i use that command:
Error using predict (line 84) Systems of network class cannot be used with the "predict" command. Convert the system to an identified model first, such as by using the "idss" command.
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Modeling and Prediction with NARX and Time-Delay Networks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!