Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/06/17 11:12:18 (7 years ago)
Author:
gkronber
Message:

#2697: merged r14843 (resolving conflicts in csproj file for HL.Algorithms.DataAnalysis because MCTS has been removed)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs

    r15141 r15142  
    164164      // A dictionary is used to find parameters
    165165      double[] initialConstants;
    166       var parameters = new List<TreeToAutoDiffTermTransformator.DataForVariable>();
    167 
    168       TreeToAutoDiffTermTransformator.ParametricFunction func;
    169       TreeToAutoDiffTermTransformator.ParametricFunctionGradient func_grad;
    170       if (!TreeToAutoDiffTermTransformator.TryTransformToAutoDiff(tree, updateVariableWeights, out parameters, out initialConstants, out func, out func_grad))
     166      var parameters = new List<TreeToAutoDiffTermConverter.DataForVariable>();
     167
     168      TreeToAutoDiffTermConverter.ParametricFunction func;
     169      TreeToAutoDiffTermConverter.ParametricFunctionGradient func_grad;
     170      if (!TreeToAutoDiffTermConverter.TryConvertToAutoDiff(tree, updateVariableWeights, out parameters, out initialConstants, out func, out func_grad))
    171171        throw new NotSupportedException("Could not optimize constants of symbolic expression tree due to not supported symbols used in the tree.");
    172172      if (parameters.Count == 0) return 0.0; // gkronber: constant expressions always have a R² of 0.0
     
    175175
    176176      //extract inital constants
    177       double[] c = new double[initialConstants.Length];
     177      double[] c = new double[initialConstants.Length + 2];
    178178      {
    179179        c[0] = 0.0;
     
    254254    }
    255255
    256     private static alglib.ndimensional_pfunc CreatePFunc(TreeToAutoDiffTermTransformator.ParametricFunction func) {
     256    private static alglib.ndimensional_pfunc CreatePFunc(TreeToAutoDiffTermConverter.ParametricFunction func) {
    257257      return (double[] c, double[] x, ref double fx, object o) => {
    258258        fx = func(c, x);
     
    260260    }
    261261
    262     private static alglib.ndimensional_pgrad CreatePGrad(TreeToAutoDiffTermTransformator.ParametricFunctionGradient func_grad) {
     262    private static alglib.ndimensional_pgrad CreatePGrad(TreeToAutoDiffTermConverter.ParametricFunctionGradient func_grad) {
    263263      return (double[] c, double[] x, ref double fx, double[] grad, object o) => {
    264264        var tupel = func_grad(c, x);
     
    268268    }
    269269    public static bool CanOptimizeConstants(ISymbolicExpressionTree tree) {
    270       return TreeToAutoDiffTermTransformator.IsCompatible(tree);
     270      return TreeToAutoDiffTermConverter.IsCompatible(tree);
    271271    }
    272272  }
Note: See TracChangeset for help on using the changeset viewer.