OneStepTrainer<?> t = (OneStepTrainer<?>) event.getSource();
NeuralNetwork n = t.getNeuralNetwork();
if (n.getLayerCalculator() != null) {
Set<Layer> calculatedLayers = new UniqueList<>();
TrainingInputData input = null;
OutputError outputError = t.getOutputError();
outputError.reset();
inputProvider.reset();
while ((input = inputProvider.getNextInput()) != null) {
calculatedLayers.clear();
calculatedLayers.add(n.getInputLayer());
ValuesProvider vp = mbe.getResults();
if (vp == null) {
vp = new ValuesProvider();
}
vp.addValues(n.getInputLayer(), input.getInput());
n.getLayerCalculator().calculate(n, n.getOutputLayer(), calculatedLayers, vp);
outputError.addItem(vp.getValues(n.getOutputLayer()), input.getTarget());
}
float e = outputError.getTotalNetworkError();
if (e <= acceptanceError) {
System.out.println("Stopping at error " + e + " (" + (e * 100) + "%) for " + mbe.getBatchCount() + " minibatches");