Changeset 5520 for branches/Algorithms.GradientDescent
- Timestamp:
- 02/19/11 11:15:50 (14 years ago)
- Location:
- branches/Algorithms.GradientDescent/HeuristicLab.Algorithms.GradientDescent/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Algorithms.GradientDescent/HeuristicLab.Algorithms.GradientDescent/3.3/HeuristicLab.Algorithms.GradientDescent.csproj
r5518 r5520 108 108 <HintPath>..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.ALGLIB-3.1.0.dll</HintPath> 109 109 </Reference> 110 <Reference Include="HeuristicLab.Analysis-3.3"> 111 <HintPath>..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Analysis-3.3.dll</HintPath> 112 </Reference> 110 113 <Reference Include="HeuristicLab.Collections-3.3"> 111 114 <HintPath>..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath> -
branches/Algorithms.GradientDescent/HeuristicLab.Algorithms.GradientDescent/3.3/LevenbergMarquardt.cs
r5516 r5520 108 108 109 109 subscopesProcessor.Operator = moveCreator; 110 111 112 113 114 110 } 115 111 -
branches/Algorithms.GradientDescent/HeuristicLab.Algorithms.GradientDescent/3.3/LevenbergMarquardtMove.cs
r5516 r5520 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 31 using HeuristicLab.Problems.TestFunctions; 32 using HeuristicLab.Analysis; 32 33 33 34 namespace HeuristicLab.Algorithms.GradientDescent { … … 75 76 double epsf = 0; 76 77 double epsx = 0; 77 int maxits = 100;78 int maxits = 0; 78 79 double diffstep = .1; 79 80 … … 82 83 alglib.minlmstate state; 83 84 alglib.minlmreport report; 84 85 alglib.minlmcreatev(solution.Length, 1,solution, diffstep, out state);85 86 alglib.minlmcreatev(solution.Length, solution, diffstep, out state); 86 87 alglib.minlmsetcond(state, epsg, epsf, epsx, maxits); 87 alglib.minlmoptimize(state, CreateCallBack(EvaluatorParameter.ActualValue), ReportProgress, null); 88 alglib.minlmsetxrep(state, true); 89 alglib.minlmoptimize(state, CreateCallBack(EvaluatorParameter.ActualValue), CreateReportProgress(ResultParameter.ActualValue), null); 88 90 alglib.minlmresults(state, out solution, out report); 89 91 … … 104 106 } 105 107 106 private void ReportProgress(double[] arg, double func, object obj) { 107 if (!ResultParameter.ActualValue.ContainsKey(QualityResultsName)) 108 ResultParameter.ActualValue.Add(new Result(QualityResultsName, new DoubleValue())); 108 private alglib.ndimensional_rep CreateReportProgress(ResultCollection results) { 109 return (double[] arg, double func, object obj) => { 110 if (!results.ContainsKey(QualityResultsName)) { 111 DataTable table = new DataTable(QualityResultsName); 112 table.Rows.Add(new DataRow("Quality")); 113 results.Add(new Result(QualityResultsName, table)); 114 } 109 115 110 ((DoubleValue)ResultParameter.ActualValue[QualityResultsName].Value).Value = func; 116 DataTable resultsTable = (DataTable)results[QualityResultsName].Value; 117 resultsTable.Rows["Quality"].Values.Add(func); 118 }; 111 119 } 112 120 }
Note: See TracChangeset
for help on using the changeset viewer.