public class SquareError extends TrainingSignalGenerator
(BackpropTrainer, RpropTrainer).
The error term that is used is
E = 1/2 (t - o)2 .
However, this function is not needed here. Instead, the Backprop trainers expect the value of a specific part of the derivative of this function. Specifically, the weight update Δw for the above error function is:
Δw = - η ⋅ ∂E/∂w, thus
Δw = - η ⋅ (t - o) ⋅ - 1 ⋅ ∂o/∂w
The back-propagation trainers only expect
error signal = (t - o)
as the so-called "error signal". The rest of the term, "- η ⋅ - 1 ⋅ ∂o/∂w", does not need to be calculated.
So for example, if another error term
E = 1/2 (t - o2)2
was used, the weight change would be
Δw = - η ⋅ ∂E/∂w = - η (t-o2) * - 2 o * ∂o/∂w
and this function would need to return
error signal = (t - o2) ⋅ 2 o .
| Constructor and Description |
|---|
SquareError() |
| Modifier and Type | Method and Description |
|---|---|
double |
computeError(NeuralNet net,
java.util.List<java.lang.Double> input,
java.util.List<java.lang.Double> target)
Computes the sum of squared errors at the output layer for the given pattern.
|
void |
computeErrorSignal(NeuralNet net,
java.util.List<java.lang.Double> input,
java.util.List<java.lang.Double> target)
Computes and sets the error signal for each output neuron to (output - target).
|
clone, fromXML, toXMLpublic void computeErrorSignal(NeuralNet net, java.util.List<java.lang.Double> input, java.util.List<java.lang.Double> target)
computeErrorSignal in class TrainingSignalGeneratornet - the neural networkinput - the input patterntarget - the target patternpublic double computeError(NeuralNet net, java.util.List<java.lang.Double> input, java.util.List<java.lang.Double> target)
computeError in class TrainingSignalGeneratornet - the neural networkinput - the input patterntarget - the target pattern