resetWeights method

void resetWeights([
  1. Random? rand
])

Implementation

void resetWeights([Random? rand]) {
  if (_nextLayer == null) return;

  var initialWeightScale = activationFunction.initialWeightScale;

  for (var i = 0; i < _weights.length; ++i) {
    var weights = _weights[i];

    for (var j = 0; j < weights.entriesLength; ++j) {
      weights.setEntryWithRandomValues(
          j, weights.toN(initialWeightScale), rand);
    }
  }
}