Can please someone explain the Artificial Neural Network code below

x=[500 900 1200 1700 2100 2500 3100 4200 5400 7000];
lag=3;
iinput=x;
n=length(iinput);
inputs=zeros(lag,n-lag);
for i=1:n-lag
inputs(:,i)=iinput(i:i+lag-1)';
end
targets=x(lag+1:end);
hiddenLayerSize = 10;
net = fitnet(hiddenLayerSize);
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
[net,tr] = train(net,inputs,targets);
yn=net(inputs);
errors=targets-yn;
figure, ploterrcorr(errors)
figure, parcorr(errors)
%[h,pValue,stat,cValue]= lbqtest(errors)
figure,plotresponse(con2seq(targets),con2seq(yn))
%figure, ploterrhist(errors)
%figure, plotperform(tr)
fn=5;
f_in=iinput(n-lag+1:end)';
f_out=zeros(1,fn);
for i=1:fn
f_out(i)=net(f_in);
f_in=[f_in(2:end);f_out(i)];
end
figure,plot(2006:2015,iinput,'b',2015:2020,[iinput(end),f_out],'r')

2 件のコメント

Walter Roberson
Walter Roberson 2017 年 7 月 13 日
What did the author's documentation about the code say?
We can explain the code, but at the moment we have no idea what parts of it you understand. We do not, for example, know whether you are familiar with addition, or with what computer programs are.
Chabui
Chabui 2017 年 7 月 13 日
編集済み: Chabui 2017 年 7 月 13 日
Here's the link to the original post: https://www.mathworks.com/matlabcentral/answers/153172-how-do-you-make-predictions-with-a-trained-neural-network-nar#answer_218843
Yes I have a foundation in computer programming and mathematics such as functions,loops,vectors etc but i'm new to neural networks...just a simple explanation and comments would really help! Thanks

サインインしてコメントする。

 採用された回答

Greg Heath
Greg Heath 2017 年 7 月 14 日

1 投票

Search
1. NEWSGROUP greg quickies
2. NEWSGROUP fitnet Hmin Hmax
3. ANSWERS fitnet Hmin Hmax
Hope this helps
Thank you for formally accepting my answer
Greg

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

質問済み:

2017 年 7 月 13 日

回答済み:

2017 年 7 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by