Changeset 17214
 Timestamp:
 08/13/19 19:02:36 (10 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/2994AutoDiffForIntervals/HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Extensions/ConstrainedNLS.cs
r17204 r17214 11 11 using HeuristicLab.Analysis; 12 12 13 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression .Extensions{13 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression { 14 14 [StorableType("676B237CDD9C4F24B64FD44B0FA1F6A6")] 15 15 [Creatable(CreatableAttribute.Categories.DataAnalysisRegression, Priority = 120)] … … 66 66 Parameters.Add(new FixedValueParameter<StringValue>(ModelStructureParameterName, "The function for which the parameters must be fit (only numeric constants are tuned).", new StringValue("1.0 * x*x + 0.0"))); 67 67 Parameters.Add(new FixedValueParameter<IntValue>(IterationsParameterName, "Determines how many iterations should be calculated while optimizing the constant of a symbolic expression tree (0 indicates other or default stopping criterion).", new IntValue(10))); 68 var validSolvers = new ItemSet<StringValue>(new[] { "MMA", "COBYLA", "CCSAQ", "ISRES" }.Select(s => new StringValue(s).AsReadOnly())); 68 var validSolvers = new ItemSet<StringValue>(new[] { 69 "MMA", 70 "COBYLA", 71 "CCSAQ", 72 "ISRES", 73 "DIRECT_G", 74 "NLOPT_GN_DIRECT_L", 75 "NLOPT_GN_DIRECT_L_RAND", 76 "NLOPT_GN_ORIG_DIRECT", 77 "NLOPT_GN_ORIG_DIRECT_L", 78 "NLOPT_GD_STOGO", 79 "NLOPT_GD_STOGO_RAND", 80 "NLOPT_LD_LBFGS_NOCEDAL", 81 "NLOPT_LD_LBFGS", 82 "NLOPT_LN_PRAXIS", 83 "NLOPT_LD_VAR1", 84 "NLOPT_LD_VAR2", 85 "NLOPT_LD_TNEWTON", 86 "NLOPT_LD_TNEWTON_RESTART", 87 "NLOPT_LD_TNEWTON_PRECOND", 88 "NLOPT_LD_TNEWTON_PRECOND_RESTART", 89 "NLOPT_GN_CRS2_LM", 90 "NLOPT_GN_MLSL", 91 "NLOPT_GD_MLSL", 92 "NLOPT_GN_MLSL_LDS", 93 "NLOPT_GD_MLSL_LDS", 94 "NLOPT_LN_NEWUOA", 95 "NLOPT_LN_NEWUOA_BOUND", 96 "NLOPT_LN_NELDERMEAD", 97 "NLOPT_LN_SBPLX", 98 "NLOPT_LN_AUGLAG", 99 "NLOPT_LD_AUGLAG", 100 "NLOPT_LN_BOBYQA", 101 "NLOPT_AUGLAG", 102 "NLOPT_LD_SLSQP", 103 "NLOPT_LD_CCSAQ", 104 "NLOPT_GN_ESCH", 105 "NLOPT_GN_AGS", 106 }.Select(s => new StringValue(s).AsReadOnly())); 69 107 Parameters.Add(new ConstrainedValueParameter<StringValue>(SolverParameterName, "The solver algorithm", validSolvers, validSolvers.First())); 70 108 Parameters.Add(new FixedValueParameter<DoubleValue>("FuncToleranceRel", new DoubleValue(0))); … … 135 173 if (CheckGradient) state.CheckGradient = true; 136 174 int idx = 0; 175 var formatter = new InfixExpressionFormatter(); 137 176 foreach(var constraintTree in state.constraintTrees) { 138 Results.AddOrUpdateResult($"Constraint {idx++}", constraintTree); 177 // HACK to remove parameter nodes which occurr multiple times 178 var reparsedTree = parser.Parse(formatter.Format(constraintTree)); 179 Results.AddOrUpdateResult($"Constraint {idx++}", reparsedTree); 139 180 } 140 181
Note: See TracChangeset
for help on using the changeset viewer.