updateWeights method

void updateWeights()

Implementation

void updateWeights() {
  // Gradient descent
  for (var p in parameters()) {
    p.setData(p.data - lr * p.grad);
  }
}