Changeset 3183


Ignore:
Timestamp:
03/22/10 17:04:46 (12 years ago)
Author:
abeham
Message:

Updated evolution strategy to include mutation strength adjustment (doh!) #932
Also added self adaptive crossover

Location:
trunk/sources/HeuristicLab.Algorithms.EvolutionStrategy/3.3
Files:
2 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.EvolutionStrategy/3.3/EvolutionStrategyMainLoop.cs

    r3148 r3183  
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2929using HeuristicLab.Selection;
     30using HeuristicLab.Encodings.RealVectorEncoding;
    3031
    3132namespace HeuristicLab.Algorithms.EvolutionStrategy {
     
    5859      get { return (ValueLookupParameter<IntValue>)Parameters["Children"]; }
    5960    }
     61    public ValueLookupParameter<RealVector> StrategyVectorParameter {
     62      get { return (ValueLookupParameter<RealVector>)Parameters["StrategyVector"]; }
     63    }
    6064    public ValueLookupParameter<DoubleMatrix> StrategyVectorBoundsParameter {
    6165      get { return (ValueLookupParameter<DoubleMatrix>)Parameters["StrategyVectorBounds"]; }
     
    117121      Parameters.Add(new ValueLookupParameter<IntValue>("Children", "λ (lambda) - the size of the offspring population."));
    118122      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed."));
     123      Parameters.Add(new ValueLookupParameter<RealVector>("StrategyVector", "The strategy vector."));
    119124      Parameters.Add(new LookupParameter<DoubleMatrix>("StrategyVectorBounds", "2 column matrix with one row for each dimension specifying upper and lower bound for the strategy vector. If there are less rows than dimensions, the strategy vector will be read in a cycle."));
    120125      Parameters.Add(new ValueLookupParameter<DoubleValue>("GeneralLearningRate", "τ0 (tau0) - the factor with which adjustments in the strategy vector is dampened over all dimensions. Recommendation is to use 1/Sqrt(2*ProblemDimension)."));
     
    146151      UniformSequentialSubScopesProcessor uniformSequentialSubScopesProcessor1 = new UniformSequentialSubScopesProcessor();
    147152      Placeholder recombinator = new Placeholder();
     153      StrategyVectorManipulator strategyMutator1 = new StrategyVectorManipulator();
    148154      Placeholder mutator1 = new Placeholder();
    149155      Placeholder evaluator1 = new Placeholder();
    150156      SubScopesRemover subScopesRemover = new SubScopesRemover();
    151157      UniformSequentialSubScopesProcessor uniformSequentialSubScopesProcessor2 = new UniformSequentialSubScopesProcessor();
     158      StrategyVectorManipulator strategyMutator2 = new StrategyVectorManipulator();
    152159      Placeholder mutator2 = new Placeholder();
    153160      Placeholder evaluator2 = new Placeholder();
     
    228235      recombinator.OperatorParameter.ActualName = RecombinatorParameter.Name;
    229236
     237      strategyMutator1.StrategyVectorParameter.ActualName = StrategyVectorParameter.Name;
     238      strategyMutator1.GeneralLearningRateParameter.ActualName = GeneralLearningRateParameter.Name;
     239      strategyMutator1.LearningRateParameter.ActualName = LearningRateParameter.Name;
     240      strategyMutator1.RandomParameter.ActualName = RandomParameter.Name;
     241
    230242      mutator1.Name = "Mutator (placeholder)";
    231243      mutator1.OperatorParameter.ActualName = MutatorParameter.Name;
     
    235247
    236248      subScopesRemover.RemoveAllSubScopes = true;
     249
     250      strategyMutator2.StrategyVectorParameter.ActualName = StrategyVectorParameter.Name;
     251      strategyMutator2.GeneralLearningRateParameter.ActualName = GeneralLearningRateParameter.Name;
     252      strategyMutator2.LearningRateParameter.ActualName = LearningRateParameter.Name;
     253      strategyMutator2.RandomParameter.ActualName = RandomParameter.Name;
    237254
    238255      mutator2.Name = "Mutator (placeholder)";
     
    310327      uniformSequentialSubScopesProcessor1.Operator = recombinator;
    311328      uniformSequentialSubScopesProcessor1.Successor = null;
    312       recombinator.Successor = mutator1;
     329      recombinator.Successor = strategyMutator1;
     330      strategyMutator1.Successor = mutator1;
    313331      mutator1.Successor = evaluator1;
    314332      evaluator1.Successor = subScopesRemover;
    315333      subScopesRemover.Successor = null;
    316       uniformSequentialSubScopesProcessor2.Operator = mutator2;
     334      uniformSequentialSubScopesProcessor2.Operator = strategyMutator2;
    317335      uniformSequentialSubScopesProcessor2.Successor = null;
     336      strategyMutator2.Successor = mutator2;
    318337      mutator2.Successor = evaluator2;
    319338      plusOrCommaReplacementBranch.TrueBranch = plusReplacement;
  • trunk/sources/HeuristicLab.Algorithms.EvolutionStrategy/3.3/HeuristicLab.Algorithms.EvolutionStrategy-3.3.csproj

    r3130 r3183  
    8484    <Compile Include="EvolutionStrategy.cs" />
    8585    <Compile Include="EvolutionStrategyMainLoop.cs" />
    86     <Compile Include="WithoutRepeatingRandomSelector.cs" />
     86    <Compile Include="SelfAdaptiveCrossover.cs" />
     87    <Compile Include="StrategyVectorManipulator.cs" />
     88    <Compile Include="WithoutRepeatingBatchedRandomSelector.cs" />
    8789  </ItemGroup>
    8890  <ItemGroup>
Note: See TracChangeset for help on using the changeset viewer.