Changeset 16813 for branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessCovarianceOptimizationProblem.cs
- Timestamp:
- 04/18/19 13:23:10 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessCovarianceOptimizationProblem.cs
r16723 r16813 22 22 using System; 23 23 using System.Linq; 24 using HEAL.Attic; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 28 29 using HeuristicLab.Optimization; 29 30 using HeuristicLab.Parameters; 30 using HEAL.Attic;31 31 using HeuristicLab.Problems.DataAnalysis; 32 32 using HeuristicLab.Problems.Instances; … … 60 60 private static readonly CovarianceSquaredExponentialIso sqrExpIso; 61 61 62 private static readonly SymbolicExpressionTreeEncoding defaultEncoding; 63 62 64 static GaussianProcessCovarianceOptimizationProblem() { 63 65 // cumbersome initialization because of ConstrainedValueParameters … … 150 152 private ICovarianceFunction covFunc; 151 153 152 public GaussianProcessCovarianceOptimizationProblem() 153 : base() { 154 public GaussianProcessCovarianceOptimizationProblem() : base(new SymbolicExpressionTreeEncoding()) { 154 155 Parameters.Add(new ValueParameter<IRegressionProblemData>(ProblemDataParameterName, "The data for the regression problem", new RegressionProblemData())); 155 156 Parameters.Add(new FixedValueParameter<IntValue>(ConstantOptIterationsParameterName, "Number of optimization steps for hyperparameter values", new IntValue(50))); 156 157 Parameters.Add(new FixedValueParameter<IntValue>(RestartsParameterName, "The number of random restarts for constant optimization.", new IntValue(10))); 157 158 Parameters["Restarts"].Hidden = true; 159 160 158 161 var g = new SimpleSymbolicExpressionGrammar(); 159 162 g.AddSymbols(new string[] { "Sum", "Product" }, 2, 2); … … 181 184 "SquaredExponentialIso" 182 185 }); 183 base.Encoding = new SymbolicExpressionTreeEncoding(g, 10, 5); 186 187 Encoding.TreeLength = 10; 188 Encoding.TreeDepth = 5; 189 Encoding.Grammar = g; 184 190 } 185 191 … … 327 333 var gradients = model.HyperparameterGradients; 328 334 Array.Copy(gradients, grad, gradients.Length); 329 } 330 catch (ArgumentException) { 335 } catch (ArgumentException) { 331 336 // building the GaussianProcessModel might fail, in this case we return the worst possible objective value 332 337 func = 1.0E+300;
Note: See TracChangeset
for help on using the changeset viewer.