- Timestamp:
- 04/30/13 11:11:45 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.GradientDescent/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.GradientDescent/3.3/Lbfgs.cs
r9408 r9409 55 55 private const string SeedParameterName = "Seed"; 56 56 private const string SetSeedRandomlyParameterName = "SetSeedRandomly"; 57 private const string GradientCheckStepSizeParameterName = "GradientCheckStepSize"; 57 58 58 59 #region parameter properties … … 65 66 public IValueParameter<BoolValue> SetSeedRandomlyParameter { 66 67 get { return (IValueParameter<BoolValue>)Parameters[SetSeedRandomlyParameterName]; } 68 } 69 public IValueParameter<DoubleValue> GradientStepSizeParameter { 70 get { return (IValueParameter<DoubleValue>)Parameters[GradientCheckStepSizeParameterName]; } 67 71 } 68 72 #endregion … … 106 110 public LbfgsAlgorithm() 107 111 : base() { 108 this.name = ItemName;109 this.description = ItemDescription;110 112 111 113 Parameters.Add(new ValueParameter<IntValue>(MaxIterationsParameterName, "The maximal number of iterations for.", new IntValue(20))); … … 113 115 Parameters.Add(new ValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true))); 114 116 Parameters.Add(new ValueParameter<BoolValue>(ApproximateGradientsParameterName, "Indicates that gradients should be approximated.", new BoolValue(true))); 115 Parameters[ApproximateGradientsParameterName].Hidden = true; // should not be changed 117 Parameters.Add(new OptionalValueParameter<DoubleValue>(GradientCheckStepSizeParameterName, "Step size for the gradient check (should be used for debugging the gradient calculation only).")); 118 // these parameter should not be changed usually 119 Parameters[ApproximateGradientsParameterName].Hidden = true; 120 Parameters[GradientCheckStepSizeParameterName].Hidden = true; 116 121 117 122 var randomCreator = new RandomCreator(); … … 133 138 randomCreator.Successor = solutionCreator; 134 139 135 solutionCreator.Name = " Solution Creator (placeholder)";140 solutionCreator.Name = "(Solution Creator)"; 136 141 solutionCreator.Successor = initializer; 137 142 … … 147 152 branch.TrueBranch = finalAnalyzer; 148 153 149 evaluator.Name = " Evaluator (placeholder)";154 evaluator.Name = "(Evaluator)"; 150 155 evaluator.Successor = updateResults; 151 156 -
trunk/sources/HeuristicLab.Algorithms.GradientDescent/3.3/LbfgsInitializer.cs
r9211 r9409 38 38 private const string IterationsParameterName = "Iterations"; 39 39 private const string ApproximateGradientsParameterName = "ApproximateGradients"; 40 private const string GradientCheckStepSizeParameterName = "GradientCheckStepSize"; 40 41 41 42 #region Parameter Properties … … 53 54 public ILookupParameter<BoolValue> ApproximateGradientsParameter { 54 55 get { return (ILookupParameter<BoolValue>)Parameters[ApproximateGradientsParameterName]; } 56 } 57 public ILookupParameter<DoubleValue> GradientStepSizeParameter { 58 get { return (ILookupParameter<DoubleValue>)Parameters[GradientCheckStepSizeParameterName]; } 55 59 } 56 60 … … 74 78 Parameters.Add(new LookupParameter<BoolValue>(ApproximateGradientsParameterName, 75 79 "Flag that indicates if gradients should be approximated.")); 80 Parameters.Add(new LookupParameter<DoubleValue>(GradientCheckStepSizeParameterName, "Step size for the gradient check (should be used for debugging the gradient calculation only).")); 76 81 // out 77 82 Parameters.Add(new LookupParameter<LbfgsState>(StateParameterName, "The state of the LM-BFGS algorithm.")); … … 93 98 alglib.minlbfgs.minlbfgssetcond(state, 0.0, 0, 0, Iterations.Value); 94 99 alglib.minlbfgs.minlbfgssetxrep(state, true); 95 // alglib.minlbfgs.minlbfgssetgradientcheck(state, 0.000001); 100 if (GradientStepSizeParameter.ActualValue != null && GradientStepSizeParameter.ActualValue.Value > 0) 101 alglib.minlbfgs.minlbfgssetgradientcheck(state, GradientStepSizeParameter.ActualValue.Value); 96 102 97 103 PointParameter.ActualValue = new RealVector(initialPoint);
Note: See TracChangeset
for help on using the changeset viewer.