Changeset 10757
- Timestamp:
- 04/17/14 15:34:25 (11 years ago)
- Location:
- branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning
- Files:
-
- 7 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning
- Property svn:ignore
-
old new 2 2 obj 3 3 bin 4 Plugin.cs
-
- Property svn:ignore
-
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning/BestSolutionAnalyzer.cs
r8753 r10757 17 17 private const string QualityParameterName = "Quality"; 18 18 private const string SymbolicExpressionTreeParameterName = "GaussianProcessConfiguration"; 19 private const string BestSolutionParameterName = "Best solution";20 19 private const string ResultsParameterName = "Results"; 21 20 private const string ProblemDataParameterName = "ProblemData"; 22 21 private const string InterpreterParameterName = "Interpreter"; 23 22 private const string SolutionParameterName = "Solution"; 23 private const string TreeParameterName = "Covariance function"; 24 24 25 25 public IScopeTreeLookupParameter<DoubleValue> QualityParameter { … … 31 31 public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { 32 32 get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; } 33 }34 public ILookupParameter<Solution> BestSolutionParameter {35 get { return (ILookupParameter<Solution>)Parameters[BestSolutionParameterName]; }36 33 } 37 34 public ILookupParameter<ResultCollection> ResultParameter { … … 55 52 Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The Gaussian process configuration to evaluate represented as symbolic expression tree.")); 56 53 Parameters.Add(new ScopeTreeLookupParameter<IGaussianProcessSolution>(SolutionParameterName, "The solution of the Gaussian process algorithm.")); 57 Parameters.Add(new LookupParameter<Solution>(BestSolutionParameterName, "The best Gaussian process configuration."));58 54 Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection of the algorithm.")); 59 55 Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName, "")); … … 85 81 } 86 82 var cloner = new Cloner(); 87 var problemData = cloner.Clone(ProblemDataParameter.ActualValue);88 var interpreter = cloner.Clone(InterpreterParameter.ActualValue);89 83 bestTree = cloner.Clone(bestTree); 90 var bestModel = new GaussianProcessRegressionModel(bestTree, problemData, interpreter);91 var bestSolutionConfiguration = new Solution(bestModel, problemData);92 93 BestSolutionParameter.ActualValue = bestSolutionConfiguration;94 84 95 85 var resultCollection = ResultParameter.ActualValue; 96 if (!resultCollection.ContainsKey(BestSolutionParameterName)) { 97 resultCollection.Add(new Result(BestSolutionParameterName, "The best Gaussian process solution", bestSolutionConfiguration)); 86 if (!resultCollection.ContainsKey(SolutionParameterName)) { 98 87 resultCollection.Add(new Result(SolutionParameterName, "The Gaussian process algorithm solution", bestSolution)); 88 resultCollection.Add(new Result(TreeParameterName, "The best covariance function", bestTree)); 99 89 } else { 100 resultCollection[BestSolutionParameterName].Value = bestSolutionConfiguration;101 90 resultCollection[SolutionParameterName].Value = bestSolution; 91 resultCollection[TreeParameterName].Value = bestTree; 102 92 } 103 93 -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning/Evaluator.cs
r9562 r10757 20 20 private const string ProblemDataParameterName = "ProblemData"; 21 21 private const string SolutionParameterName = "Solution"; 22 private const string IterationsParameterName = "Iterations"; 22 23 23 24 public ILookupParameter<DoubleValue> QualityParameter { … … 36 37 get { return (ILookupParameter<IRegressionProblemData>)Parameters[ProblemDataParameterName]; } 37 38 } 39 public ILookupParameter<IntValue> IterationsParameter { 40 get { return (ILookupParameter<IntValue>)Parameters[IterationsParameterName]; } 41 } 38 42 39 43 [StorableConstructor] … … 46 50 Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName, "The solution quality of the Gaussian process configuration.")); 47 51 Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(GaussianProcessConfigurationParameterName, "The Gaussian process configuration to evaluate represented as symbolic expression tree.")); 52 Parameters.Add(new LookupParameter<IntValue>(IterationsParameterName, "Number of LM-BFGS iterations for hyper-parameter optimization.")); 48 53 Parameters.Add(new LookupParameter<Interpreter>(InterpreterParameterName, "The interpreter to use for evaluating Gaussian process configurations represented as trees.")); 49 54 Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName, "To regression problem data for which to learn a Gaussian process.")); … … 63 68 double quality; 64 69 IGaussianProcessSolution solution; 65 InterpreterParameter.ActualValue.EvaluateGaussianProcessConfiguration(tree, ProblemDataParameter.ActualValue, out quality, out solution);70 InterpreterParameter.ActualValue.EvaluateGaussianProcessConfiguration(tree, ProblemDataParameter.ActualValue, IterationsParameter.ActualValue.Value, out quality, out solution); 66 71 67 72 if (double.IsInfinity(quality) || double.IsNaN(quality)) quality = 1E6; // a large value -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning/GaussianProcessTuning.csproj
r9562 r10757 123 123 <Private>False</Private> 124 124 </Reference> 125 <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 126 <SpecificVersion>False</SpecificVersion> 127 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath> 128 </Reference> 125 129 <Reference Include="HeuristicLab.Random-3.3"> 126 130 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath> … … 141 145 <ItemGroup> 142 146 <Compile Include="BestSolutionAnalyzer.cs" /> 143 <Compile Include="GaussianProcessRegressionModel.cs" />144 147 <Compile Include="Interpreter.cs"> 145 148 <SubType>Code</SubType> 146 149 </Compile> 147 <Compile Include="Parameters.cs" />148 <Compile Include="Provider.cs" />149 <Compile Include="Solution.cs" />150 150 <Compile Include="Grammar.cs" /> 151 151 <Compile Include="Problem.cs" /> … … 159 159 <None Include="Plugin.cs.frame" /> 160 160 <None Include="Properties\AssemblyInfo.cs.frame" /> 161 </ItemGroup>162 <ItemGroup>163 <ProjectReference Include="..\HeuristicLab.Algorithms.DataAnalysis.Experimental\HeuristicLab.Algorithms.DataAnalysis.Experimental.csproj">164 <Project>{6142B24E-9C86-410B-A65A-1DE65C8C2349}</Project>165 <Name>HeuristicLab.Algorithms.DataAnalysis.Experimental</Name>166 </ProjectReference>167 161 </ItemGroup> 168 162 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning/Grammar.cs
r9562 r10757 42 42 private void Initialize() { 43 43 // create all symbols 44 var meanZero = new MeanZero(); 44 45 //var meanOne = new MeanOne(); 45 var meanConst = new MeanConst();46 var meanLinear = new MeanLinear(Dimension);46 //var meanConst = new MeanConst(); 47 //var meanLinear = new MeanLinear(Dimension); 47 48 //var meanScale = new MeanScale(); 48 var meanSum = new MeanSum();49 var meanProd = new MeanProd();49 //var meanSum = new MeanSum(); 50 //var meanProd = new MeanProd(); 50 51 //var meanPow2 = new MeanPow(2) { Name = "MeanPow2" }; 51 52 //var meanPow3 = new MeanPow(3) { Name = "MeanPow3" }; … … 70 71 var covPeriodic1 = new CovPeriodic(1.0); 71 72 covPeriodic1.Name = "CovPeriodic(1.0)"; 72 var covPeriodicCO = new CovPeriodic(0.021817864467425927);73 covPeriodicCO.Name = "CovPeriodicCO";73 //var covPeriodicCO = new CovPeriodic(0.021817864467425927); 74 //covPeriodicCO.Name = "CovPeriodicCO"; 74 75 var covNoise = new CovNoise(); 75 76 var covScale = new CovScale(); … … 83 84 var meanSymbols = new List<ISymbol>() 84 85 { 85 meanConst, 86 meanLinear, 87 meanSum, 88 meanProd, 86 meanZero, 87 //meanConst, 88 //meanLinear, 89 //meanSum, 90 //meanProd, 89 91 //meanPow2, 90 92 //meanPow3, … … 108 110 covPeriodic, 109 111 covPeriodic1, 110 covPeriodicCO,112 //covPeriodicCO, 111 113 covNoise, 112 114 covScale, … … 137 139 AddAllowedChildSymbol(configurationStartSymbol, likSymbol, 2); 138 140 } 139 foreach (var meanFunctionSymbol in new ISymbol[] { meanSum, meanProd }) {140 foreach (var meanSymbol in meanSymbols) {141 for (int i = 0; i < meanFunctionSymbol.MaximumArity; i++) {142 AddAllowedChildSymbol(meanFunctionSymbol, meanSymbol, i);143 }144 }145 }141 //foreach (var meanFunctionSymbol in new ISymbol[] { meanSum, meanProd }) { 142 // foreach (var meanSymbol in meanSymbols) { 143 // for (int i = 0; i < meanFunctionSymbol.MaximumArity; i++) { 144 // AddAllowedChildSymbol(meanFunctionSymbol, meanSymbol, i); 145 // } 146 // } 147 //} 146 148 147 149 foreach (var covFunctionSymbol in new ISymbol[] { covSum, covProd, covScale }) { … … 171 173 covPeriodic, 172 174 covPeriodic1, 173 covPeriodicCO,175 //covPeriodicCO, 174 176 }) { 175 177 for (int i = 0; i < covMask.MaximumArity; i++) { -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning/Interpreter.cs
r9562 r10757 26 26 } 27 27 28 public void EvaluateGaussianProcessConfiguration(ISymbolicExpressionTree tree, IRegressionProblemData problemData, out double negLogLikelihood, out IGaussianProcessSolution solution) {28 public void EvaluateGaussianProcessConfiguration(ISymbolicExpressionTree tree, IRegressionProblemData problemData, int iterations, out double negLogLikelihood, out IGaussianProcessSolution solution) { 29 29 var meanFunction = GetMeanFunction(tree); 30 30 var covFunction = GetCovFunction(tree); … … 36 36 gprAlg.GaussianProcessModelCreatorParameter.Value = 37 37 gprAlg.GaussianProcessModelCreatorParameter.ValidValues.First( 38 v => v is EigenGaussianProcessRegressionModelCreator);39 gprAlg.MinimizationIterations = 50;38 v => v is GaussianProcessRegressionModelCreator); 39 gprAlg.MinimizationIterations = iterations; 40 40 41 41 var signal = new AutoResetEvent(false); -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning/Plugin.cs.frame
r9338 r10757 17 17 [PluginDependency("HeuristicLab.Persistence", "3.3")] 18 18 [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")] 19 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 19 20 [PluginDependency("HeuristicLab.Random", "3.3")] 20 21 [PluginDependency("HeuristicLab.Selection", "3.3")] -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning/Problem.cs
r8753 r10757 10 10 using HeuristicLab.PluginInfrastructure; 11 11 using HeuristicLab.Problems.DataAnalysis; 12 using HeuristicLab.Problems.Instances; 12 13 13 14 namespace HeuristicLab.Problems.GaussianProcessTuning { … … 15 16 [Creatable("Problems")] 16 17 [Item("Gaussian Process Configuration Problem", "The Gaussian process configuration problem for genetic programming.")] 17 public class Problem : SingleObjectiveHeuristicOptimizationProblem<Evaluator, ISymbolicExpressionTreeCreator> { 18 public class Problem : SingleObjectiveHeuristicOptimizationProblem<Evaluator, ISymbolicExpressionTreeCreator>, 19 IProblemInstanceConsumer<IRegressionProblemData>, IProblemInstanceExporter<IRegressionProblemData> { 18 20 private const string GaussianProcessConfigurationParameterName = "GaussianProcessConfiguration"; 19 21 private const string MaxGaussianProcessConfigurationLengthParameterName = "MaxConfigurationLength"; … … 23 25 private const string InterpreterParameterName = "Interpreter"; 24 26 private const string ProblemDataParameterName = "ProblemData"; 27 private const string IterationsParameterName = "Iterations"; 25 28 26 29 … … 43 46 get { return (IValueParameter<IRegressionProblemData>)Parameters[ProblemDataParameterName]; } 44 47 } 48 public IFixedValueParameter<IntValue> IterationsParameter { 49 get { return (IFixedValueParameter<IntValue>)Parameters[IterationsParameterName]; } 50 } 45 51 46 52 [StorableConstructor] … … 55 61 : base(new Evaluator(), new ProbabilisticTreeCreator()) { 56 62 Parameters.Add(new ValueParameter<Interpreter>(InterpreterParameterName, "The interpreter for Gaussian process configurations represented as trees.", new Interpreter())); 57 Parameters.Add(new FixedValueParameter<IntValue>(DimensionParameterName, "The dimension parameter for the Gaussian process configuration.", new IntValue(1 0)));58 Parameters.Add(new FixedValueParameter<IntValue>(MaxGaussianProcessConfigurationParameterName, "Maximal depth of the Gaussian process configuration.", new IntValue( 6)));59 Parameters.Add(new FixedValueParameter<IntValue>(MaxGaussianProcessConfigurationLengthParameterName, "Maximal length of the Gaussian process configuration.", new IntValue( 15)));63 Parameters.Add(new FixedValueParameter<IntValue>(DimensionParameterName, "The dimension parameter for the Gaussian process configuration.", new IntValue(1))); 64 Parameters.Add(new FixedValueParameter<IntValue>(MaxGaussianProcessConfigurationParameterName, "Maximal depth of the Gaussian process configuration.", new IntValue(7))); 65 Parameters.Add(new FixedValueParameter<IntValue>(MaxGaussianProcessConfigurationLengthParameterName, "Maximal length of the Gaussian process configuration.", new IntValue(25))); 60 66 Parameters.Add(new ValueParameter<Grammar>(GaussianProcessConfigurationGrammarParameterName, "Grammar for the Gaussian process configuration.", 61 67 new Grammar())); 62 68 Parameters.Add(new ValueParameter<IRegressionProblemData>(ProblemDataParameterName, "The problem data to learn a Gaussian process for.", new RegressionProblemData())); 69 Parameters.Add(new FixedValueParameter<IntValue>(IterationsParameterName, "The number of LM-BFGS iterations for hyper-parameter tuning.", new IntValue(50))); 63 70 Maximization.Value = false; 64 71 InitializeOperators(); … … 167 174 } 168 175 } 176 177 public void Load(IRegressionProblemData data) { 178 Name = data.Name; 179 Description = data.Description; 180 ProblemDataParameter.Value = data; 181 } 182 183 public IRegressionProblemData Export() { 184 return ProblemDataParameter.Value; 185 } 169 186 } 170 187 } -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning/Properties
-
Property
svn:ignore
set to
AssemblyInfo.cs
-
Property
svn:ignore
set to
Note: See TracChangeset
for help on using the changeset viewer.