protected void PropogateForward(Step downstream, int output)
{
double sumSquaredError = 0;
int inputIndex = 0;
int definitionIndex = output * InputLength;
foreach (Step upstream in downstream.Upstream)
{
Debug.Assert(inputIndex + upstream.Length <= InputLength);
for (int i = 0; i < upstream.Length; i++)
{
double difference = upstream.Output[i] - ClassStateDefinitions[definitionIndex];
sumSquaredError += difference * difference;
inputIndex += 1;
definitionIndex += 1;
}
}
downstream.Output[output] = sumSquaredError;
}