Changeset 9099
- Timestamp:
- 01/03/13 15:30:41 (12 years ago)
- Location:
- branches/HeuristicLab.Problems.GaussianProcessTuning
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.GaussianProcessTuning.Tests/UnitTest.cs
r8873 r9099 2 2 using System.Linq; 3 3 using System.Threading; 4 using HeuristicLab.Algorithms.DataAnalysis; 4 5 using HeuristicLab.Algorithms.GeneticAlgorithm; 5 6 using HeuristicLab.Problems.DataAnalysis; -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.Instances.DataAnalysis.GaussianProcessRegression/GaussianProcessPolyTen.cs
r8873 r9099 129 129 covarianceFunction.Terms.Add(t5); 130 130 131 covarianceFunction.SetParameter(hyp.ToArray());131 var cov = covarianceFunction.GetParameterizedCovarianceFunction(hyp, Enumerable.Range(0, AllowedInputVariables.Count())); 132 132 133 var target = Util.SampleGaussianProcess(mt, covarianceFunction, data); 133 134 var target = Util.SampleGaussianProcess(mt, cov, data); 134 135 data.Add(target); 135 136 -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.Instances.DataAnalysis.GaussianProcessRegression/GaussianProcessSEIso.cs
r8826 r9099 56 56 covarianceFunction.Terms.Add(new CovarianceSquaredExponentialIso()); 57 57 covarianceFunction.Terms.Add(new CovarianceNoise()); 58 covarianceFunction.SetParameter(new double[] { Math.Log(0.1), Math.Log(Math.Sqrt(1)), Math.Log(Math.Sqrt(0.01)) }); 58 var cov = 59 covarianceFunction.GetParameterizedCovarianceFunction( 60 new double[] { Math.Log(0.1), Math.Log(Math.Sqrt(1)), Math.Log(Math.Sqrt(0.01)) }, 61 Enumerable.Range(0, AllowedInputVariables.Count())); 59 62 60 63 var mt = new MersenneTwister(31415); 61 var target = Util.SampleGaussianProcess(mt, cov arianceFunction, data);64 var target = Util.SampleGaussianProcess(mt, cov, data); 62 65 data.Add(target); 63 66 -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.Instances.DataAnalysis.GaussianProcessRegression/GaussianProcessSEIso1.cs
r8879 r9099 65 65 covFun.Terms.Add(m1); 66 66 covFun.Terms.Add(new CovarianceNoise()); 67 covFun.SetParameter(hyp.ToArray());68 67 68 var cov = covFun.GetParameterizedCovarianceFunction(hyp, Enumerable.Range(0, AllowedInputVariables.Count())); 69 69 var mt = new MersenneTwister(); 70 var target = Util.SampleGaussianProcess(mt, cov Fun, data);70 var target = Util.SampleGaussianProcess(mt, cov, data); 71 71 data.Add(target); 72 72 -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.Instances.DataAnalysis.GaussianProcessRegression/GaussianProcessSEIso2.cs
r8879 r9099 70 70 covFun.Terms.Add(m2); 71 71 covFun.Terms.Add(new CovarianceNoise()); 72 covFun.SetParameter(hyp.ToArray());72 var cov = covFun.GetParameterizedCovarianceFunction(hyp, Enumerable.Range(0, AllowedInputVariables.Count())); 73 73 74 74 var mt = new MersenneTwister(); 75 var target = Util.SampleGaussianProcess(mt, cov Fun, data);75 var target = Util.SampleGaussianProcess(mt, cov, data); 76 76 data.Add(target); 77 77 -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.Instances.DataAnalysis.GaussianProcessRegression/GaussianProcessSEIso3.cs
r8879 r9099 75 75 covFun.Terms.Add(m3); 76 76 covFun.Terms.Add(new CovarianceNoise()); 77 covFun.SetParameter(hyp.ToArray());77 var cov = covFun.GetParameterizedCovarianceFunction(hyp, Enumerable.Range(0, AllowedInputVariables.Count())); 78 78 79 79 var mt = new MersenneTwister(); 80 var target = Util.SampleGaussianProcess(mt, cov Fun, data);80 var target = Util.SampleGaussianProcess(mt, cov, data); 81 81 data.Add(target); 82 82 -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.Instances.DataAnalysis.GaussianProcessRegression/GaussianProcessSEIso4.cs
r8879 r9099 65 65 covFun.Terms.Add(m1); 66 66 covFun.Terms.Add(new CovarianceNoise()); 67 covFun.SetParameter(hyp.ToArray());68 67 68 var cov = covFun.GetParameterizedCovarianceFunction(hyp, Enumerable.Range(0, AllowedInputVariables.Count())); 69 69 var mt = new MersenneTwister(); 70 var target = Util.SampleGaussianProcess(mt, cov Fun, data);70 var target = Util.SampleGaussianProcess(mt, cov, data); 71 71 data.Add(target); 72 72 -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.Instances.DataAnalysis.GaussianProcessRegression/GaussianProcessSEIso5.cs
r8879 r9099 69 69 covFun.Terms.Add(m2); 70 70 covFun.Terms.Add(new CovarianceNoise()); 71 covFun.SetParameter(hyp.ToArray());71 var cov = covFun.GetParameterizedCovarianceFunction(hyp, Enumerable.Range(0, AllowedInputVariables.Count())); 72 72 73 73 var mt = new MersenneTwister(); 74 var target = Util.SampleGaussianProcess(mt, cov Fun, data);74 var target = Util.SampleGaussianProcess(mt, cov, data); 75 75 data.Add(target); 76 76 -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.Instances.DataAnalysis.GaussianProcessRegression/GaussianProcessSEIso6.cs
r8879 r9099 80 80 covFun.Terms.Add(m4); 81 81 covFun.Terms.Add(new CovarianceNoise()); 82 covFun.SetParameter(hyp.ToArray()); 82 var cov = covFun.GetParameterizedCovarianceFunction(hyp, Enumerable.Range(0, AllowedInputVariables.Count())); 83 83 84 84 85 var mt = new MersenneTwister(); 85 var target = Util.SampleGaussianProcess(mt, cov Fun, data);86 var target = Util.SampleGaussianProcess(mt, cov, data); 86 87 data.Add(target); 87 88 -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.Instances.DataAnalysis.GaussianProcessRegression/GaussianProcessSEIsoDependentNoise.cs
r8873 r9099 67 67 Math.Log(Math.Sqrt(0.01)) // noise 68 68 }; 69 covarianceFunction.SetParameter(hyp);69 var cov = covarianceFunction.GetParameterizedCovarianceFunction(hyp, Enumerable.Range(0, AllowedInputVariables.Count())); 70 70 71 71 var mt = new MersenneTwister(31415); 72 var target = Util.SampleGaussianProcess(mt, cov arianceFunction, data);72 var target = Util.SampleGaussianProcess(mt, cov, data); 73 73 data.Add(target); 74 74 -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.Instances.DataAnalysis.GaussianProcessRegression/Instances.DataAnalysis.GaussianProcessRegression-3.3.csproj
r8879 r9099 213 213 </PropertyGroup> 214 214 <PropertyGroup> 215 <PreBuildEvent /> 215 <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 216 set ProjectDir=$(ProjectDir) 217 set SolutionDir=$(SolutionDir) 218 set Outdir=$(Outdir) 219 220 call PreBuildEvent.cmd 221 </PreBuildEvent> 216 222 </PropertyGroup> 217 223 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
branches/HeuristicLab.Problems.GaussianProcessTuning/HeuristicLab.Problems.Instances.DataAnalysis.GaussianProcessRegression/Util.cs
r8873 r9099 32 32 33 33 34 public static List<double> SampleGaussianProcess(IRandom random, ICovarianceFunction covFunction, List<List<double>> data) {34 public static List<double> SampleGaussianProcess(IRandom random, ParameterizedCovarianceFunction covFunction, List<List<double>> data) { 35 35 36 36 double[,] x = new double[data[0].Count, data.Count]; … … 41 41 for (int i = 0; i < K.GetLength(0); i++) 42 42 for (int j = i; j < K.GetLength(1); j++) 43 K[i, j] = covFunction. GetCovariance(x, i, j, null);43 K[i, j] = covFunction.Covariance(x, i, j); 44 44 45 45 var normalRand = new NormalDistributedRandom(random, 0, 1);
Note: See TracChangeset
for help on using the changeset viewer.