propagateBackwards method

void propagateBackwards(
  1. List<double> input,
  2. List<double> expected
)
inherited

Performs the backpropagation algorithm by comparing the observed values with the expected values, and propagates each layer using the knowledge of the network's 'cost', which indicates how bad the network is performing.

Implementation

void propagateBackwards(List<double> input, List<double> expected) {
  final observed = process(input);

  var errors = subtract(expected, observed);

  for (var index = layers.length - 1; index > 0; index--) {
    errors = layers[index].propagate(errors);
  }
}