- Timestamp:
- 07/31/12 18:26:03 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess
- Files:
-
- 7 added
- 12 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
Note: See TracChangeset
for help on using the changeset viewer.