Changeset 8371
- Timestamp:
- 07/31/12 18:26:03 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 7 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinear.cs
r8366 r8371 4 4 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 5 5 6 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{6 namespace HeuristicLab.Algorithms.DataAnalysis { 7 7 [StorableClass] 8 8 [Item(Name = "CovarianceLinear", Description = "Linear covariance function with for Gaussian processes.")] -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSEard.cs
r8323 r8371 5 5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 6 7 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{7 namespace HeuristicLab.Algorithms.DataAnalysis { 8 8 [StorableClass] 9 9 [Item(Name = "CovarianceSEard", Description = "Squared exponential covariance function with automatic relevance determination for Gaussian processes.")] -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSEiso.cs
r8323 r8371 5 5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 6 6 7 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{7 namespace HeuristicLab.Algorithms.DataAnalysis { 8 8 [StorableClass] 9 9 [Item(Name = "CovarianceSEiso", -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs
r8366 r8371 28 28 using HeuristicLab.Problems.DataAnalysis; 29 29 30 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{30 namespace HeuristicLab.Algorithms.DataAnalysis { 31 31 /// <summary> 32 32 /// Represents a Gaussian process model. -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegression.cs
r8325 r8371 21 21 #endregion 22 22 23 using System; 23 24 using System.Collections.Generic; 24 25 using System.Linq; … … 27 28 using HeuristicLab.Core; 28 29 using HeuristicLab.Data; 30 using HeuristicLab.Operators; 29 31 using HeuristicLab.Optimization; 30 32 using HeuristicLab.Parameters; … … 34 36 using HeuristicLab.Random; 35 37 36 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{38 namespace HeuristicLab.Algorithms.DataAnalysis { 37 39 /// <summary> 38 40 ///Gaussian process regression data analysis algorithm. … … 41 43 [Creatable("Data Analysis")] 42 44 [StorableClass] 43 public sealed class GaussianProcessRegression : FixedDataAnalysisAlgorithm<IRegressionProblem> { 45 public sealed class GaussianProcessRegression : EngineAlgorithm, IStorableContent { 46 public string Filename { get; set; } 47 48 public override Type ProblemType { get { return typeof(IRegressionProblem); } } 49 public new IRegressionProblem Problem { 50 get { return (IRegressionProblem)base.Problem; } 51 set { base.Problem = value; } 52 } 53 44 54 private const string MeanFunctionParameterName = "MeanFunction"; 45 55 private const string CovarianceFunctionParameterName = "CovarianceFunction"; 46 private const string MinimizationIterationsParameterName = " MinimizationIterations";47 private const string NegativeLogLikelihoodTableParameterName = "NegativeLogLikelihoodTable";48 private const string HyperParametersTableParameterName = "HyperParametersTable";56 private const string MinimizationIterationsParameterName = "Iterations"; 57 //private const string NegativeLogLikelihoodTableParameterName = "NegativeLogLikelihoodTable"; 58 //private const string HyperParametersTableParameterName = "HyperParametersTable"; 49 59 50 60 #region parameter properties … … 95 105 Parameters.Add(new ConstrainedValueParameter<ICovarianceFunction>(CovarianceFunctionParameterName, "The covariance function to use.", 96 106 new ItemSet<ICovarianceFunction>(covFunctions), covFunctions.First())); 97 Parameters.Add(new ValueParameter<IntValue>(MinimizationIterationsParameterName, "The number of iterations for likelihood optimization .", new IntValue(20)));107 Parameters.Add(new ValueParameter<IntValue>(MinimizationIterationsParameterName, "The number of iterations for likelihood optimization with BFGS.", new IntValue(20))); 98 108 //Parameters.Add(new LookupParameter<DataTable>(NegativeLogLikelihoodTableParameterName, "The negative log likelihood values over the whole run.")); 99 109 //Parameters.Add(new LookupParameter<DataTable>(HyperParametersTableParameterName, "The values of the hyper-parameters over the whole run.")); 110 111 var setParameterLength = new GaussianProcessSetHyperparameterLength(); 112 var initializer = new BFGSInitializer(); 113 var makeStep = new BFGSMakeStep(); 114 var branch = new ConditionalBranch(); 115 var modelCreator = new GaussianProcessRegressionModelCreator(); 116 var updateResults = new BFGSUpdateResults(); 117 118 OperatorGraph.InitialOperator = setParameterLength; 119 120 setParameterLength.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName; 121 setParameterLength.MeanFunctionParameter.ActualName = MeanFunctionParameterName; 122 setParameterLength.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name; 123 setParameterLength.Successor = initializer; 124 125 initializer.IterationsParameter.ActualName = MinimizationIterationsParameterName; 126 initializer.NumberOfHyperparameterParameter.ActualName = setParameterLength.NumberOfHyperparameterParameter.Name; 127 initializer.Successor = makeStep; 128 129 makeStep.BFGSStateParameter.ActualName = initializer.BFGSStateParameter.Name; 130 makeStep.HyperparameterParameter.ActualName = initializer.NumberOfHyperparameterParameter.Name; 131 makeStep.Successor = branch; 132 133 branch.ConditionParameter.ActualName = makeStep.TerminationCriterionParameter.Name; 134 branch.FalseBranch = modelCreator; 135 136 modelCreator.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name; 137 modelCreator.MeanFunctionParameter.ActualName = MeanFunctionParameterName; 138 modelCreator.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName; 139 modelCreator.HyperparameterParameter.ActualName = initializer.HyperparameterParameter.Name; 140 modelCreator.Successor = updateResults; 141 142 updateResults.BFGSStateParameter.ActualName = initializer.BFGSStateParameter.Name; 143 updateResults.FunctionValueParameter.ActualName = modelCreator.NegativeLogLikelihoodParameter.Name; 144 updateResults.HyperparameterGradientsParameter.ActualName = modelCreator.HyperparameterGradientsParameter.Name; 145 updateResults.Successor = makeStep; 146 100 147 } 101 148 [StorableHook(HookType.AfterDeserialization)] … … 105 152 return new GaussianProcessRegression(this, cloner); 106 153 } 107 154 /* 108 155 #region Gaussian process regression 109 156 protected override void Run() { … … 215 262 216 263 #endregion 264 */ 217 265 } 218 266 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolution.cs
r8323 r8371 25 25 using HeuristicLab.Problems.DataAnalysis; 26 26 27 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{27 namespace HeuristicLab.Algorithms.DataAnalysis { 28 28 /// <summary> 29 29 /// Represents a Gaussian process solution for a regression problem which can be visualized in the GUI. -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/ICovarianceFunction.cs
r8323 r8371 3 3 using HeuristicLab.Core; 4 4 5 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{5 namespace HeuristicLab.Algorithms.DataAnalysis { 6 6 public interface ICovarianceFunction : IItem { 7 7 int GetNumberOfParameters(int numberOfVariables); -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/IMeanFunction.cs
r8366 r8371 2 2 using HeuristicLab.Core; 3 3 4 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{4 namespace HeuristicLab.Algorithms.DataAnalysis { 5 5 public interface IMeanFunction : IItem { 6 6 int GetNumberOfParameters(int numberOfVariables); -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanConst.cs
r8366 r8371 6 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{8 namespace HeuristicLab.Algorithms.DataAnalysis { 9 9 [StorableClass] 10 10 [Item(Name = "MeanConst", Description = "Constant mean function for Gaussian processes.")] -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanLinear.cs
r8368 r8371 6 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{8 namespace HeuristicLab.Algorithms.DataAnalysis { 9 9 [StorableClass] 10 10 [Item(Name = "MeanLinear", Description = "Linear mean function for Gaussian processes.")] -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanZero.cs
r8366 r8371 6 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 7 7 8 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{8 namespace HeuristicLab.Algorithms.DataAnalysis { 9 9 [StorableClass] 10 10 [Item(Name = "MeanZero", Description = "Constant zero mean function for Gaussian processes.")] -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/Util.cs
r8366 r8371 5 5 using System.Linq; 6 6 7 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{7 namespace HeuristicLab.Algorithms.DataAnalysis { 8 8 public static class Util { 9 9 public static double ScalarProd(IEnumerable<double> v, IEnumerable<double> u) { … … 17 17 18 18 public static double SqrDist(IEnumerable<double> x, IEnumerable<double> y) { 19 return Math.Max(x.Zip(y, (a, b) => (a - b) * (a - b)).Sum(), 0);19 return x.Zip(y, SqrDist).Sum(); 20 20 } 21 21 -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r8366 r8371 122 122 </Compile> 123 123 <Compile Include="FixedDataAnalysisAlgorithm.cs" /> 124 <Compile Include="GaussianProcess\BFGSInitializer.cs" /> 125 <Compile Include="GaussianProcess\BFGSState.cs" /> 126 <Compile Include="GaussianProcess\BFGSUpdateResults.cs" /> 127 <Compile Include="GaussianProcess\BFGSMakeStep.cs" /> 128 <Compile Include="GaussianProcess\GaussianProcessSetHyperparameterLength.cs" /> 129 <Compile Include="GaussianProcess\GaussianProcessRegressionModelCreator.cs" /> 124 130 <Compile Include="GaussianProcess\CovarianceLinear.cs" /> 131 <Compile Include="GaussianProcess\GaussianProcessModelCreator.cs"> 132 <SubType>Code</SubType> 133 </Compile> 125 134 <Compile Include="GaussianProcess\MeanLinear.cs" /> 126 135 <Compile Include="GaussianProcess\Util.cs" /> … … 237 246 <Private>False</Private> 238 247 </ProjectReference> 248 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj"> 249 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project> 250 <Name>HeuristicLab.Operators-3.3</Name> 251 </ProjectReference> 252 <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj"> 253 <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project> 254 <Name>HeuristicLab.Optimization.Operators-3.3</Name> 255 </ProjectReference> 239 256 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 240 257 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModel.cs
r8323 r8371 23 23 using HeuristicLab.Problems.DataAnalysis; 24 24 25 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{25 namespace HeuristicLab.Algorithms.DataAnalysis { 26 26 /// <summary> 27 27 /// Interface to represent a Gaussian process posterior … … 32 32 ICovarianceFunction CovarianceFunction { get; } 33 33 IEnumerable<double> Hyperparameters { get; } 34 double[] GetHyperparameterGradients(); 34 35 } 35 36 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessSolution.cs
r8323 r8371 22 22 using HeuristicLab.Problems.DataAnalysis; 23 23 24 namespace HeuristicLab.Algorithms.DataAnalysis .GaussianProcess{24 namespace HeuristicLab.Algorithms.DataAnalysis { 25 25 /// <summary> 26 26 /// Interface to represent a Gaussian process solution (either regression or classification) -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Plugin.cs.frame
r8323 r8371 37 37 [PluginDependency("HeuristicLab.Data", "3.3")] 38 38 [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")] 39 [PluginDependency("HeuristicLab.Operators", "3.3")] 39 40 [PluginDependency("HeuristicLab.Optimization", "3.3")] 41 [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")] 40 42 [PluginDependency("HeuristicLab.Parameters", "3.3")] 41 43 [PluginDependency("HeuristicLab.Persistence", "3.3")] -
trunk/sources/HeuristicLab.Algorithms.ScatterSearch/3.3
- Property svn:ignore
-
old new 1 1 *.user 2 2 Plugin.cs 3 obj
-
- Property svn:ignore
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.DayView/1.0
- Property svn:ignore
-
old new 3 3 HeuristicLab.DayView-1.0.csproj.user 4 4 *.vs10x 5 *.user
-
- Property svn:ignore
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/2.4.1/ProtobufCS/src/ProtoGen
- Property svn:ignore
-
old new 1 1 bin 2 2 obj 3 *.user
-
- Property svn:ignore
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/2.4.1/ProtobufCS/src/ProtocolBuffers
- Property svn:ignore
-
old new 1 1 bin 2 2 obj 3 *.user
-
- Property svn:ignore
-
trunk/sources/HeuristicLab.Tests/HeuristicLab-3.3/GaussianProcessRegressionTest.cs
r8323 r8371 25 25 using System.Threading; 26 26 using HeuristicLab.Algorithms.DataAnalysis; 27 using HeuristicLab.Algorithms.DataAnalysis.GaussianProcess;28 27 using HeuristicLab.Common; 29 28 using HeuristicLab.Core; 30 29 using HeuristicLab.Problems.DataAnalysis; 30 using HeuristicLab.SequentialEngine; 31 31 using Microsoft.VisualStudio.TestTools.UnitTesting; 32 32 … … 59 59 60 60 var cv = new CrossValidation(); 61 cv.Algorithm = new GaussianProcessRegression(); 61 var alg = new GaussianProcessRegression(); 62 alg.Engine = new SequentialEngine(); 63 cv.Algorithm = alg; 64 65 cv.Problem = new RegressionProblem(); 62 66 var rand = new HeuristicLab.Random.MersenneTwister(); 63 67 double[,] data = GenerateData(100, rand); … … 65 69 Dataset ds = new Dataset(variables, data); 66 70 cv.Problem.ProblemDataParameter.ActualValue = new RegressionProblemData(ds, variables.Take(10), variables.Last()); 71 cv.Algorithm.Prepare(); 67 72 cv.Folds.Value = 5; 68 73 cv.SamplesStart.Value = 0;
Note: See TracChangeset
for help on using the changeset viewer.