Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/18/11 16:09:35 (14 years ago)
Author:
gkronber
Message:

Implemented multiplicative manipulation of constants and variable weights. #1384

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableTreeNode.cs

    r4989 r5326  
    6868    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
    6969      base.ShakeLocalParameters(random, shakingFactor);
    70       double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulatorMu, Symbol.WeightManipulatorSigma);
    71       weight = weight + x * shakingFactor;
     70      // 50% additive & 50% multiplicative
     71      if (random.NextDouble() < 0) {
     72        double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulatorMu, Symbol.WeightManipulatorSigma);
     73        weight = weight + x * shakingFactor;
     74      } else {       
     75        double x = NormalDistributedRandom.NextDouble(random, 1.0, Symbol.MultiplicativeWeightManipulatorSigma);
     76        weight = weight * x;
     77      }
    7278      variableName = Symbol.VariableNames.SelectRandom(random);
    7379    }
Note: See TracChangeset for help on using the changeset viewer.