Skip to content

Commit

Permalink
Changed random weight deltas to be gaussian with a sigma of 0.01 inst…
Browse files Browse the repository at this point in the history
…ead of 0.1. This matches SharpNEAT 2.x. The intention for the SharpNEAT 4.0 release was to keep parameters such as these identical to SharpNEAT 2.x, so that the core neuroevolution algorithm is as close as possible between the two versions, despite the big architectural overhaul.

This allows us to compare the performance/efficacy of 2.x and 4.x, to give some assurance that there isn't some bug/flaw in the 4.x code base that impacts performance.

Future releases can then be free to explore tuning of hyper parameters and such, once we have established that 4.x performs at least as well as 2.x.
  • Loading branch information
colgreen committed Aug 5, 2023
1 parent 3424bba commit 6563d87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/SharpNeat/Neat/NeatPopulationFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ private NeatPopulationFactory(
_innovationIdSeq = new Int32Sequence(nextInnovationId);

// Init random connection weight source.
// TODO: Consider using gaussian samples here. One of the big leaps in backpropagation learning was related to avoiding large connection weights in the initial random weights.
_connWeightDist = UniformDistributionSamplerFactory.CreateStatelessSampler<T>(_metaNeatGenome.ConnectionWeightScale, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public static WeightMutationScheme<double> CreateDefaultScheme(double weightScal
probabilityArr[0] = 0.5985;
probabilityArr[1] = 0.2985;
probabilityArr[2] = 0.0985;
strategyArr[0] = CreateCardinalGaussianDeltaStrategy(1, 0.1);
strategyArr[1] = CreateCardinalGaussianDeltaStrategy(2, 0.1);
strategyArr[2] = CreateCardinalGaussianDeltaStrategy(3, 0.1);
strategyArr[0] = CreateCardinalGaussianDeltaStrategy(1, 0.01);
strategyArr[1] = CreateCardinalGaussianDeltaStrategy(2, 0.01);
strategyArr[2] = CreateCardinalGaussianDeltaStrategy(3, 0.01);

// Reset mutations. 1, 2 and 3 connections respectively.
probabilityArr[3] = 0.015;
Expand Down

0 comments on commit 6563d87

Please sign in to comment.