Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8397


Ignore:
Timestamp:
08/02/12 17:39:37 (12 years ago)
Author:
gkronber
Message:

#1902 added random seed parameters for BFGS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/Lbfgs.cs

    r8396 r8397  
    5959    private const string MaxIterationsParameterName = "MaxIterations";
    6060    private const string ApproximateGradientsParameterName = "ApproximateGradients";
     61    private const string SeedParameterName = "Seed";
     62    private const string SetSeedRandomlyParameterName = "SetSeedRandomly";
    6163
    6264    #region parameter properties
    6365    public IValueParameter<IntValue> MaxIterationsParameter {
    6466      get { return (IValueParameter<IntValue>)Parameters[MaxIterationsParameterName]; }
     67    }
     68    public IValueParameter<IntValue> SeedParameter {
     69      get { return (IValueParameter<IntValue>)Parameters[SeedParameterName]; }
     70    }
     71    public IValueParameter<BoolValue> SetSeedRandomlyParameter {
     72      get { return (IValueParameter<BoolValue>)Parameters[SetSeedRandomlyParameterName]; }
    6573    }
    6674    #endregion
     
    7078      get { return MaxIterationsParameter.Value.Value; }
    7179    }
     80    public int Seed { get { return SeedParameter.Value.Value; } set { SeedParameter.Value.Value = value; } }
     81    public bool SetSeedRandomly { get { return SetSeedRandomlyParameter.Value.Value; } set { SetSeedRandomlyParameter.Value.Value = value; } }
    7282    #endregion
     83
    7384    [StorableConstructor]
    7485    private LbfgsAlgorithm(bool deserializing) : base(deserializing) { }
     
    8495
    8596      Parameters.Add(new ValueParameter<IntValue>(MaxIterationsParameterName, "The maximal number of iterations for.", new IntValue(20)));
     97      Parameters.Add(new ValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
     98      Parameters.Add(new ValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
    8699      Parameters.Add(new ValueParameter<BoolValue>(ApproximateGradientsParameterName, "Indicates that gradients should be approximated.", new BoolValue(true)));
    87100      Parameters[ApproximateGradientsParameterName].Hidden = true; // should not be changed
     
    99112      OperatorGraph.InitialOperator = randomCreator;
    100113
     114      randomCreator.SeedParameter.ActualName = SeedParameterName;
     115      randomCreator.SeedParameter.Value = null;
     116      randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameterName;
     117      randomCreator.SetSeedRandomlyParameter.Value = null;
    101118      randomCreator.Successor = solutionCreator;
    102119
Note: See TracChangeset for help on using the changeset viewer.