@Override
protected void calculateTrainingError(DoubleVector labels, DoubleVector output) {
DoubleVector errors = labels.deepCopy().applyToElements(output,
this.costFunction);
// System.out.printf("Labels: %s\tOutput: %s\n", labels, output);
this.trainingError = errors.sum();
// System.out.printf("Training error: %s\n", errors);
}
/**
* Get the squashing function of a specified layer.