masmoudi mostefa
Member
السلام عليكم و رحمة الله و بركاته
اريد مساعدة في شرح هذا الكود الشبكات العصبية باستخدام برنامج الماتلاب
% normalization
[pn,ps]=mapminmax(p); % p is the input data matrix (training)
[tn,ts]=mapminmax(t); % t is the output data matrix (training)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
net=newff(minmax(pn), [5 1], {'tansig','purelin'},'trainbr');
net.trainParam.show = 50; % The result is shown at every # epoch
net.trainParam.lr = 0.05; % Learning rate used in some gradient schemes
net.trainParam.epochs = 1000; % Max number of iterations
net.trainParam.goal = 1e-3; % Error tolerance; stopping criterion
net = init(net);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% train network
[net,tr,Y,E] = train(net, pn, tn);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% To simulate the training data
an = sim(net,pn);
% denormaliz
a = mapminmax('reverse',an,ts);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% load forecasting
pt1n = mapminmax('apply',pt1,ps); % inputs for forecasting
pf1n = sim(net,pt1n);
pf1 = mapminmax('reverse',pf1n,ts); % forecasted load consumption
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
اريد مساعدة في شرح هذا الكود الشبكات العصبية باستخدام برنامج الماتلاب
% normalization
[pn,ps]=mapminmax(p); % p is the input data matrix (training)
[tn,ts]=mapminmax(t); % t is the output data matrix (training)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
net=newff(minmax(pn), [5 1], {'tansig','purelin'},'trainbr');
net.trainParam.show = 50; % The result is shown at every # epoch
net.trainParam.lr = 0.05; % Learning rate used in some gradient schemes
net.trainParam.epochs = 1000; % Max number of iterations
net.trainParam.goal = 1e-3; % Error tolerance; stopping criterion
net = init(net);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% train network
[net,tr,Y,E] = train(net, pn, tn);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% To simulate the training data
an = sim(net,pn);
% denormaliz
a = mapminmax('reverse',an,ts);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% load forecasting
pt1n = mapminmax('apply',pt1,ps); % inputs for forecasting
pf1n = sim(net,pt1n);
pf1 = mapminmax('reverse',pf1n,ts); % forecasted load consumption
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%