Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/18/19 13:23:10 (6 years ago)
Author:
mkommend
Message:

#2521: Changed base ctor call in all GeneticProgrammingProblems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessCovarianceOptimizationProblem.cs

    r16723 r16813  
    2222using System;
    2323using System.Linq;
     24using HEAL.Attic;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
     
    2829using HeuristicLab.Optimization;
    2930using HeuristicLab.Parameters;
    30 using HEAL.Attic;
    3131using HeuristicLab.Problems.DataAnalysis;
    3232using HeuristicLab.Problems.Instances;
     
    6060    private static readonly CovarianceSquaredExponentialIso sqrExpIso;
    6161
     62    private static readonly SymbolicExpressionTreeEncoding defaultEncoding;
     63
    6264    static GaussianProcessCovarianceOptimizationProblem() {
    6365      // cumbersome initialization because of ConstrainedValueParameters
     
    150152    private ICovarianceFunction covFunc;
    151153
    152     public GaussianProcessCovarianceOptimizationProblem()
    153       : base() {
     154    public GaussianProcessCovarianceOptimizationProblem() : base(new SymbolicExpressionTreeEncoding()) {
    154155      Parameters.Add(new ValueParameter<IRegressionProblemData>(ProblemDataParameterName, "The data for the regression problem", new RegressionProblemData()));
    155156      Parameters.Add(new FixedValueParameter<IntValue>(ConstantOptIterationsParameterName, "Number of optimization steps for hyperparameter values", new IntValue(50)));
    156157      Parameters.Add(new FixedValueParameter<IntValue>(RestartsParameterName, "The number of random restarts for constant optimization.", new IntValue(10)));
    157158      Parameters["Restarts"].Hidden = true;
     159
     160
    158161      var g = new SimpleSymbolicExpressionGrammar();
    159162      g.AddSymbols(new string[] { "Sum", "Product" }, 2, 2);
     
    181184        "SquaredExponentialIso"
    182185      });
    183       base.Encoding = new SymbolicExpressionTreeEncoding(g, 10, 5);
     186
     187      Encoding.TreeLength = 10;
     188      Encoding.TreeDepth = 5;
     189      Encoding.Grammar = g;
    184190    }
    185191
     
    327333        var gradients = model.HyperparameterGradients;
    328334        Array.Copy(gradients, grad, gradients.Length);
    329       }
    330       catch (ArgumentException) {
     335      } catch (ArgumentException) {
    331336        // building the GaussianProcessModel might fail, in this case we return the worst possible objective value
    332337        func = 1.0E+300;
Note: See TracChangeset for help on using the changeset viewer.