Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModelCreator.cs @ 8396

Last change on this file since 8396 was 8396, checked in by gkronber, 12 years ago

#1902 implemented LM-BFGS algorithm and improved GPR

File size: 4.6 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using HeuristicLab.Common;
23using HeuristicLab.Core;
24using HeuristicLab.Data;
25using HeuristicLab.Encodings.RealVectorEncoding;
26using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
27using HeuristicLab.Operators;
28using HeuristicLab.Parameters;
29using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
30using HeuristicLab.Problems.DataAnalysis;
31
32namespace HeuristicLab.Algorithms.DataAnalysis {
33  [StorableClass]
34  // base class for GaussianProcessModelCreators (specific for classification and regression)
35  public abstract class GaussianProcessModelCreator : SingleSuccessorOperator {
36    private const string HyperparameterParameterName = "Hyperparameter";
37    private const string MeanFunctionParameterName = "MeanFunction";
38    private const string CovarianceFunctionParameterName = "CovarianceFunction";
39    private const string ModelParameterName = "Model";
40    private const string NegativeLogLikelihoodParameterName = "NegativeLogLikelihood";
41    private const string HyperparameterGradientsParameterName = "HyperparameterGradients";
42
43    #region Parameter Properties
44    // in
45    public ILookupParameter<RealVector> HyperparameterParameter {
46      get { return (ILookupParameter<RealVector>)Parameters[HyperparameterParameterName]; }
47    }
48    public ILookupParameter<IMeanFunction> MeanFunctionParameter {
49      get { return (ILookupParameter<IMeanFunction>)Parameters[MeanFunctionParameterName]; }
50    }
51    public ILookupParameter<ICovarianceFunction> CovarianceFunctionParameter {
52      get { return (ILookupParameter<ICovarianceFunction>)Parameters[CovarianceFunctionParameterName]; }
53    }
54    // out
55    public ILookupParameter<IGaussianProcessModel> ModelParameter {
56      get { return (ILookupParameter<IGaussianProcessModel>)Parameters[ModelParameterName]; }
57    }
58    public ILookupParameter<RealVector> HyperparameterGradientsParameter {
59      get { return (ILookupParameter<RealVector>)Parameters[HyperparameterGradientsParameterName]; }
60    }
61    public ILookupParameter<DoubleValue> NegativeLogLikelihoodParameter {
62      get { return (ILookupParameter<DoubleValue>)Parameters[NegativeLogLikelihoodParameterName]; }
63    }
64
65    #endregion
66
67    #region Properties
68    protected RealVector Hyperparameter { get { return HyperparameterParameter.ActualValue; } }
69    protected IMeanFunction MeanFunction { get { return MeanFunctionParameter.ActualValue; } }
70    protected ICovarianceFunction CovarianceFunction { get { return CovarianceFunctionParameter.ActualValue; } }
71    #endregion
72
73    [StorableConstructor]
74    protected GaussianProcessModelCreator(bool deserializing) : base(deserializing) { }
75    protected GaussianProcessModelCreator(GaussianProcessModelCreator original, Cloner cloner) : base(original, cloner) { }
76    protected GaussianProcessModelCreator()
77      : base() {
78      // in
79      Parameters.Add(new LookupParameter<RealVector>(HyperparameterParameterName, "The hyperparameters for the Gaussian process model."));
80      Parameters.Add(new LookupParameter<IMeanFunction>(MeanFunctionParameterName, "The mean function for the Gaussian process model."));
81      Parameters.Add(new LookupParameter<ICovarianceFunction>(CovarianceFunctionParameterName, "The covariance function for the Gaussian process model."));
82      // out
83      Parameters.Add(new LookupParameter<IGaussianProcessModel>(ModelParameterName, "The resulting Gaussian process model"));
84      Parameters.Add(new LookupParameter<RealVector>(HyperparameterGradientsParameterName, "The gradients of the hyperparameters for the produced Gaussian process model (necessary for hyperparameter optimization)"));
85      Parameters.Add(new LookupParameter<DoubleValue>(NegativeLogLikelihoodParameterName, "The negative log-likelihood of the produced Gaussian process model given the data."));
86    }
87  }
88}
Note: See TracBrowser for help on using the repository browser.