Changeset 15356
- Timestamp:
- 09/08/17 10:41:30 (7 years ago)
- Location:
- branches/SimplifierViewsProgress
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs
r15353 r15356 51 51 applyLinearScaling: true, maxIterations: constOptIterations, updateVariableWeights: true, lowerEstimationLimit: regressionModelModel.LowerEstimationLimit, upperEstimationLimit: regressionModelModel.UpperEstimationLimit, 52 52 iterationCallback: (args, func, obj) => { 53 // (maxIterations + 2) iterations are reported; Math.Min neccecary because of floating-point inaccuracies54 progress.ProgressValue = Math.Min( progress.ProgressValue + 1.0 / (constOptIterations + 2), 1);53 double newProgressValue = progress.ProgressValue + 1.0 / (constOptIterations + 2); // (maxIterations + 2) iterations are reported 54 progress.ProgressValue = Math.Min(newProgressValue, 1.0); 55 55 }); 56 56 return model.SymbolicExpressionTree; -
branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r15353 r15356 185 185 progress.Start("Calculate Impact and Replacement Values ...", 0); 186 186 var impactAndReplacementValues = await Task.Run(() => CalculateImpactAndReplacementValues(tree)); 187 await Task.Delay(500); // wait for progressbar to finish animation 187 188 var replacementValues = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item2); 188 189 foreach (var pair in replacementValues.Where(pair => !(pair.Key is ConstantTreeNode))) { … … 199 200 double impactValue, replacementValue, newQualityForImpactsCalculation; 200 201 impactCalculator.CalculateImpactAndReplacementValues(Content.Model, node, Content.ProblemData, Content.ProblemData.TrainingIndices, out impactValue, out replacementValue, out newQualityForImpactsCalculation); 201 progress.ProgressValue += 1.0 / (tree.Length - 2); 202 double newProgressValue = progress.ProgressValue + 1.0 / (tree.Length - 2); 203 progress.ProgressValue = Math.Min(newProgressValue, 1); 202 204 impactAndReplacementValues.Add(node, new Tuple<double, double>(impactValue, replacementValue)); 203 205 } … … 298 300 progress.Start("Optimizing Constants ...", 0); 299 301 var newTree = await Task.Run(() => OptimizeConstants(Content.Model, Content.ProblemData, progress)); 302 await Task.Delay(500); // wait for progressbar to finish animation 300 303 UpdateModel(newTree); // UpdateModel calls Progress.Finish (via Content_Changed) 301 304 }
Note: See TracChangeset
for help on using the changeset viewer.