protected override void PreTrainCore(Step downstream)
{
int inputIndex = 0;
foreach (Step upstream in downstream.Upstream)
{
Debug.Assert(inputIndex + upstream.Length <= InputLength);
for (int i = 0; i < upstream.Length; i++)
{
// Error second derivative relative to output is constant, as first derivative is 2.0 * (state - desiredState).
upstream.ErrorDerivative[inputIndex] = 2.0;
inputIndex += 1;
}
}
}