Advertisement
Zalosin

Untitled

Mar 23rd, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.44 KB | None | 0 0
  1. % net = newp([-1 1; -1 1;-1 1], 1);
  2. % net.IW{1} = [0 1 0];
  3. % net.b{1} = 0;
  4. % exemple = 2*rand(10,3) - 1;
  5. % etichete = sim(net,exemple');
  6.  
  7. p = 2*rand(2,1000) -1;
  8. y = zeros(1,1000);
  9. y(p(1,:)-p(2,:) > 0 ) = 1;
  10. net = newp([-1 1;-1 1], 1);
  11. %Antrenare
  12. net.IW{1};
  13. net.b{1};
  14. y2 = sim(net,p);
  15. net = train(net,p,y);
  16. net.IW{1};
  17. net.b{1};
  18. plot( p(1,y==1),p(2,y==1),'*r');
  19. hold on;
  20. plot(p(1,y==0),p(2,y==0),'oc');
  21. plotpc(net.IW{1},net.b{1});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement