void ComputeBackward(LearningExample learningExample, INeuralNetAccessor outputGradient) { int lastLayer = neuralNetAccessor.NumberOfLayers - 1; ComputeLastDeltas(learningExample.Output, outputGradient); ComputeWeightGradients(lastLayer, learningExample.Input, outputGradient); for (int layer = lastLayer - 1; layer >= 0; layer--) { ComputeDeltas(layer, outputGradient); ComputeWeightGradients(layer, learningExample.Input, outputGradient); } }
public void BackPropagate(LearningExample learningExample, INeuralNetAccessor outputGradient) { ComputeForward(learningExample.Input); ComputeBackward(learningExample, outputGradient); }