Usage problem of saved neural network
Mostrar comentarios más antiguos
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!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!