Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all
- close all
- format compact
- nntwarn off
- load wagi
- Pn = -1:0.1:-0.5;
- Tn = [-.9602 -.5770 -.0729 .3771 .6405 .6600];
- S1_vec = [7]; %Ilość neuronów w pierwszej warstwie
- S2_vec = [7]; %Ilość neuronów w drugiej warstwie
- [S3,Q] = size(Tn); %Ilość neuronów w warstwie wyjściowej
- disp_freq = 500; %Czestotliwosc wyswietlania wynikow
- max_epoch = 10000; %Maksymalna liczba epok
- err_goal = 0.001; %Error goal
- lr = 0.001; %Learning rate
- lr_inc_vec = [1.05]; %Zgodnie ze wzorem instrukcji do laboratorium lr_inc_vec
- lr_dec_vec = [0.7]; %Zgodnie ze wzorem instrukcji do laboratorium lr_dec_vec
- mc_vec = [0.9]; %Momentum constant
- er_vec = [1.04]; %Maximum error ratio
- liczba_petli = length(S1_vec)*length(S2_vec)*length(lr_inc_vec)*length(lr_dec_vec)*length(er_vec)*length(mc_vec);
- ind_petli = 0;
- ind_petli2 = 0;
- qmax=0;
- SSEmin=10000;
- for ind_S1=1:length(S1_vec),
- for ind_S2=1:length(S2_vec),
- for ind_lr_inc=1:length(lr_inc_vec),
- for ind_lr_dec=1:length(lr_dec_vec),
- for ind_er=1:length(er_vec),
- [W1,B1,W2,B2,W3,B3] = initff(Pn,S1_vec(ind_S1),'tansig',S2_vec(ind_S2),'tansig',S3,'purelin');
- save wagi
- TP = [disp_freq max_epoch err_goal lr lr_inc_vec(ind_lr_inc) lr_dec_vec(ind_lr_dec) er_vec(ind_er)];
- [W1,B1,W2,B2,W3,B3,TE,TR] = trainbpa(W1,B1,'tansig',W2,B2,'tansig',W3,B3,'purelin',Pn,Tn,TP);
- a = simuff(Pn,W1,B1,'tansig',W2,B2,'tansig',W3,B3,'purelin');
- q = (1-sum(abs(Tn-a)>=0.5)/length(Pn))*100;
- SSE = TR(1,TE+1);
- end
- end
- end
- end
- end
- epoch
- SSE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement