for (int i = 0, batch = 0; i < getEpochs() * getTrainingInputProvider().getInputSize() && !stopTraining; i += getTrainingBatchSize(), batch++) {
TrainingInputData input = getInput();
getTrainingInputProvider().populateNext(input);
learnInput(batch);
triggerEvent(new MiniBatchFinishedEvent(this, input, null, batch));
if (i % getTrainingInputProvider().getInputSize() == 0) {
triggerEvent(new EpochFinishedEvent(this, input, null, i / getTrainingInputProvider().getInputSize()));
}
}