// tanh can be used to minimise the impact of big error values, which can cause network instability
// suggested at https://sourceforge.net/tracker/?func=detail&atid=1107579&aid=3130561&group_id=238532
// double neuronError = Math.tanh(neuron.getError());
Weight weight = connection.getWeight();
double currentWeighValue = weight.getValue();
double previousWeightValue = weight.getTrainingData().get(TrainingData.PREVIOUS_WEIGHT);
double deltaWeight = this.learningRate * neuronError * input +
momentum * (currentWeighValue - previousWeightValue);
// save previous weight value
weight.getTrainingData().set(TrainingData.PREVIOUS_WEIGHT, currentWeighValue);
this.applyWeightChange(weight, deltaWeight);
}
}