public void Mutate(Random random, NodeParameters parameters) { _bias += (random.NextDouble() * 2 - 1) * parameters.Bias.Rate; if (random.NextDouble() < parameters.Function.SwapRate) { ActivationFunction = ActivationFunctions.GetRandom(random, parameters.Function); } else { ActivationFunction.Mutate(random, parameters.Function); } if (random.NextDouble() < (_isEnabled ? parameters.DisableRate : parameters.EnableRate)) { _isEnabled = !_isEnabled; } }
public RandomParameters(EdgeParameters edge, NodeParameters node) { Edge = edge; Node = node; }