SHARE
TWEET

Untitled

a guest Jan 24th, 2020 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. protected void epoch() {
  2.         for (Point point : points) {
  3.             double minDistance = Double.MAX_VALUE;
  4.             double distance;
  5.             int winnerIndex = 0;
  6.             for (int i = 0; i < neurons.size(); i++) {
  7.                 distance = point.calculateDistance(neurons.get(i));
  8.                 if (distance < minDistance) {
  9.                     minDistance = distance;
  10.                     winnerIndex = i;
  11.                 }
  12.             }
  13.             neurons.get(winnerIndex).moveCloser(point, 0.005);
  14.         }
  15.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top