Guest User

Untitled

a guest
Apr 5th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. public void policzPunkty3( List<Punkt> lista)
  2. {
  3. double a = 1.0;
  4. double b = 1.0;
  5. double c = 1.0;
  6. double suma1=0.0;
  7. double suma2=0.0;
  8. double suma3=0.0;
  9. double pochodna =0.0;
  10. Random r = new Random();
  11. for (int i=0;i<1000;i++){
  12.  
  13. Punkt losuj = lista.get(r.nextInt(lista.size()));
  14. double x=losuj.getX();
  15. double y=losuj.getY();
  16. double wejscie = a * x + b * y+c*1;
  17. double wyjscie = sigmoidalfun(wejscie);
  18. double d= sigmoidalfun(-1 * x + 1 * y);
  19. pochodna=(-0.5)*(d - wyjscie) * (wyjscie * (1 - wyjscie));
  20. suma1=suma1+pochodna*x;
  21. suma2=suma2+pochodna*y;
  22. suma3=suma3+pochodna*1;
  23.  
  24. }
  25.  
  26. a=a-suma1;
  27. b=b-suma2;
  28. c=c-suma3;
  29. Funkcje funkcje = new Funkcje(a,b,c);
  30. fun3.add(funkcje);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment