in.momentum = 0;
in.inputs = input;
in.targets = output;
ITrainingBuilder trainBuilder = new TrainingBuilder();
ITraining train = trainBuilder.build();
TrainingOutput out = new TrainingOutput(0.00005);
train.train(network, in, out);
System.out.printf("Solution in %d iteration, minError = %f, lastError: %f\n\n", out.lastIterationNumber, out.minError, out.lastError);
final XYSeries series2 = new XYSeries("Prediction");
SimulationIterator iterator;
for (int i = 0; i < input.length; i++) {
for (iterator = train.simulate(input[i]); iterator.hasNext();) {
series2.add(input[i][0], iterator.next());
}
}
XYSeriesCollection collection = new XYSeriesCollection();