I have used nnstart to predict future values of my time-series data, what is succeded, and I saved the network to .m file, what I can't use for further use for similar data. The automatically generated script works if the final line is outputs = train(net,inputs,targets,inputStates,layerStates); but is not working with the saved net instead of train, even not with the data the saved network trained with. So I tried just simply to replace the
outputs = train(net,inputs,targets,inputStates,layerStates);
to
load('mynet', 'net');
outputs = net(inputs,inputStates,layerStates);
or even
outputs = net(inputs,inputStates,layerStates,targets);
but not works, even not for the same sample data that it used for the train. The code was:
inputSeries = pollutionInputs;
targetSeries = pollutionTargets;
inputDelays = 1:2;
feedbackDelays = 1:2;
hiddenLayerSize = 10;
load('mynet', 'net')
[inputs,inputStates,layerStates,targets] = preparets(net,inputSeries,{},targetSeries);
outputs = net(inputs,inputStates,layerStates);
Where the final line produces the error:
Output argument "data" (and maybe others) not assigned during call to "C:\Program
Files\MATLAB\R2012b\toolbox\nnet\nnet\@network\sim.m>simData".
Error in network/sim (line 291)
[data,err] = simData(net,X,Xi,Ai,T,EW);
Error in network/subsref (line 17)
otherwise, v = sim(vin,subs{:});
Error in narx2 (line 71)
outputs = net(inputs,inputStates,layerStates);
What could cause the problem, and how I could use the saved and loaded network for new datas?
Thank you in advance!

 채택된 답변

Greg Heath
Greg Heath 2014년 10월 7일

1 개 추천

1. Check the loaded net to make sure it has all the correct properties
net = net % NO SEMICOLON!
2. Sequentially remove ending semicolons to make sure the command line outputs at each stage makes sense.
Hope this helps.
Thank you for formally accepting my answer
Greg

댓글 수: 1

Roland Kilik
Roland Kilik 2014년 10월 7일
Starting from your advice (however I already examined the command line output of net before) it seems to work. At least, net = net produced only "[1x1 network]", but net=load('mynet', '-mat') netin=net.mynet seems to work, as it displays all the struct of the newrok
Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

질문:

2014년 10월 6일

댓글:

2014년 10월 7일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by