Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void epoch() {
- for (Point point : points) {
- double minDistance = Double.MAX_VALUE;
- double distance;
- int winnerIndex = 0;
- for (int i = 0; i < neurons.size(); i++) {
- distance = point.calculateDistance(neurons.get(i));
- if (distance < minDistance) {
- minDistance = distance;
- winnerIndex = i;
- }
- }
- neurons.get(winnerIndex).moveCloser(point, 0.005);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement