Finally i wrote this code for wind speed prediction with 3 parameters, why does my code has different prediction for the same dataset on each run?

5 次查看(过去 30 天)
load('input.mat');
X = tonndata(inputData(:,(1:3)),false,false);
T = tonndata(inputData(:,4),false,false);
N = 100; % Multi-step ahead prediction
inputSeries = X(1:end);
targetSeries = T(1:end);
inputSeriesVal = X(end-N+1:end);
targetSeriesVal = T(end-N+1:end);
delay = 1; %one hour
neuronsHiddenLayer = 10;
% Network Creation
net = narxnet(1:delay,1:delay,neuronsHiddenLayer);
[Xs,Xi,Ai,Ts] = preparets(net,inputSeries,{},targetSeries);
net = train(net,Xs,Ts,Xi,Ai);
view(net)
Y = net(Xs,Xi,Ai);
% Performance for the series-parallel implementation, only
% one-step-ahead prediction
perf = perform(net,Ts,Y);
[Xs1,Xio,Aio] = preparets(net,inputSeries(1:end-delay),{},targetSeries(1:end-delay));
[Y1,Xfo,Afo] = net(Xs1,Xio,Aio);
[netc,Xic,Aic] = closeloop(net,Xfo,Afo);
[yPred,Xfc,Afc] = netc(inputSeriesVal,Xic,Aic);
multiStepPerformance = perform(net,yPred,targetSeriesVal);
view(netc)
figure;
plot([cell2mat(targetSeries),nan(1,N);
nan(1,length(targetSeries)),cell2mat(yPred);]')
legend('Original Targets','Network Predictions')

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Parallel and Cloud 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by