createRandomWeight method

double createRandomWeight(
  1. Random random, {
  2. double? scale,
})

Generates a random weight compatible with this activation function.

Implementation

double createRandomWeight(Random random, {double? scale}) {
  scale ??= initialWeightScale;
  return (random.nextDouble() * (scale * 2)) - scale;
}