Changeset 15319 for branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Timestamp:
- 08/10/17 13:49:26 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs
r14951 r15319 156 156 int maxIterations, bool updateVariableWeights = true, 157 157 double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue, 158 bool updateConstantsInTree = true ) {158 bool updateConstantsInTree = true, Action<double[], double, int> iterationReport = null) { 159 159 160 160 // numeric constants in the tree become variables for constant opt … … 211 211 alglib.ndimensional_pgrad function_cx_1_grad = CreatePGrad(func_grad); 212 212 213 int i = 0; 214 var xrep = new alglib.ndimensional_rep((a, f, o) => { 215 if (iterationReport != null) iterationReport(a, f, i++); 216 }); 217 213 218 try { 214 219 alglib.lsfitcreatefg(x, y, c, n, m, k, false, out state); 215 220 alglib.lsfitsetcond(state, 0.0, 0.0, maxIterations); 221 alglib.lsfitsetxrep(state, iterationReport != null); 216 222 //alglib.lsfitsetgradientcheck(state, 0.001); 217 alglib.lsfitfit(state, function_cx_1_func, function_cx_1_grad, null, null);223 alglib.lsfitfit(state, function_cx_1_func, function_cx_1_grad, xrep, null); 218 224 alglib.lsfitresults(state, out retVal, out c, out rep); 219 } 220 catch (ArithmeticException) { 225 } catch (ArithmeticException) { 221 226 return originalQuality; 222 } 223 catch (alglib.alglibexception) { 227 } catch (alglib.alglibexception) { 224 228 return originalQuality; 225 229 }
Note: See TracChangeset
for help on using the changeset viewer.