Perceptron: Difference between revisions

Content added Content deleted
Line 64: Line 64:
}
}


new Timer(30, (ActionEvent e) -> {
new Timer(10, (ActionEvent e) -> {
repaint();
repaint();
}).start();
}).start();
Line 107: Line 107:
g.setStroke(new BasicStroke(2));
g.setStroke(new BasicStroke(2));
g.setColor(Color.orange);
g.setColor(Color.orange);
g.drawLine(0, 0, x, y);
g.drawLine(0, (int) f(0), x, y);


train(training[count].inputs, training[count].answer);
train(training[count].inputs, training[count].answer);
Line 140: Line 140:
}
}
}</lang>
}</lang>
[[File:perceptron_java.gif]]



=={{header|JavaScript}}==
=={{header|JavaScript}}==