public void run() {
List<MLData> samples = new ArrayList<MLData>();
for (int i = 0; i < 15; i++) {
MLData data = new BasicMLData(3);
data.setData(0, RangeRandomizer.randomize(-1, 1));
data.setData(1, RangeRandomizer.randomize(-1, 1));
data.setData(2, RangeRandomizer.randomize(-1, 1));
samples.add(data);
}
this.train.setAutoDecay(1000, 0.8, 0.003, 30, 5);
for (int i = 0; i < 1000; i++) {
int idx = (int) (Math.random() * samples.size());
MLData c = samples.get(idx);
this.train.trainPattern(c);
this.train.autoDecay();
this.map.repaint();
System.out.println("Iteration " + i + "," + this.train.toString());