Advertisement
bartek27210

si

May 17th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.88 KB | None | 0 0
  1. %LVQ Neural network training
  2.  
  3. clear all  
  4. nntwarn off
  5. load DANE
  6.  
  7. S1 = [4:1:10 15:5:100];  
  8. epoch = [1:400:1600 2000:2000:20000];
  9. lr = [0.01 : .01: 1];
  10. x = length(S1)*length(epoch)*length(rate);
  11. i = 1;
  12.  
  13. wynik = zeros([x length(T)]);
  14. index = zeros([x 5]);
  15. Tc = ind2vec(T);
  16.  
  17. for S1_ite = 1:length(S1)
  18.  
  19.     for epoch_ite = 1:length(epoch)
  20.         for lr_ite = 1:length(rate)
  21.             TP = [1000 epoch(epoch_ite) lr(lr_ite)];
  22.            
  23.             [w1, w2] = initlvq(Pn, S1(S1_ite), Tc);
  24.             [w1, w2] = trainlvq(w1, w2, Pn, Tc, TP);
  25.            
  26.             a = simulvq(Pn, w1, w2);
  27.             wynik = vec2ind(a);
  28.  
  29.             sprawnosc = (1-sum(abs(T-wynik)>=0.5)/length(Pn))*100
  30.             Procent = i/x*100
  31.             index(i,:) = [i, S1(S1_ite), epoch(epoch_ite), lr(lr_ite), sprawnosc];
  32.             i=i+1;
  33.         end
  34.     end
  35. end
  36.  
  37. save Wyniki index
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement