List<DoubleVector> internalResults = this.getOutputInternal(inputInstance);
DoubleVector output = internalResults.get(internalResults.size() - 1);
// get the training error
calculateTrainingError(labels,
output.deepCopy().sliceUnsafe(1, output.getDimension() - 1));
if (this.trainingMethod.equals(TrainingMethod.GRADIENT_DESCENT)) {
return this.trainByInstanceGradientDescent(labels, internalResults);
} else {
throw new IllegalArgumentException(