BayesOpt
nonparametricprocess.hpp
Go to the documentation of this file.
1 
3 /*
4 -------------------------------------------------------------------------
5  This file is part of BayesOpt, an efficient C++ library for
6  Bayesian optimization.
7 
8  Copyright (C) 2011-2015 Ruben Martinez-Cantin <rmcantin@unizar.es>
9 
10  BayesOpt is free software: you can redistribute it and/or modify it
11  under the terms of the GNU Affero General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  BayesOpt is distributed in the hope that it will be useful, but
16  WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU Affero General Public License for more details.
19 
20  You should have received a copy of the GNU Affero General Public License
21  along with BayesOpt. If not, see <http://www.gnu.org/licenses/>.
22 ------------------------------------------------------------------------
23 */
24 
25 
26 #ifndef __BAYESIANREGRESSOR_HPP__
27 #define __BAYESIANREGRESSOR_HPP__
28 
29 #include "dataset.hpp"
30 #include "prob_distribution.hpp"
31 #include "mean_functors.hpp"
32 #include "optimizable.hpp"
33 
34 namespace bayesopt
35 {
36 
44  {
45  public:
46  NonParametricProcess(size_t dim, Parameters parameters,
47  const Dataset& data,
48  MeanModel& mean,
49  randEngine& eng);
50 
51  virtual ~NonParametricProcess();
52 
58  static NonParametricProcess* create(size_t dim, Parameters parameters,
59  const Dataset& data,
60  MeanModel& mean, randEngine& eng);
61 
69  virtual ProbabilityDistribution* prediction(const vectord &query) = 0;
70 
78  virtual void fitSurrogateModel() = 0;
79 
87  virtual void updateSurrogateModel() = 0;
88 
89 
90  // Getters and setters
91  double getValueAtMinimum();
92  const Dataset* getData();
93  double getSignalVariance();
94 
95  virtual size_t nHyperParameters() = 0;
96  virtual vectord getHyperParameters() = 0;
97  virtual void setHyperParameters(const vectord& theta) = 0;
98 
99 
100  protected:
101  const Dataset& mData;
102  double mSigma;
103  size_t dim_;
104  MeanModel& mMean;
105  };
106 
109 
110  inline double NonParametricProcess::getValueAtMinimum()
111  { return mData.getValueAtMinimum(); };
112 
113 
114  inline const Dataset* NonParametricProcess::getData()
115  {return &mData;}
116 
117  inline double NonParametricProcess::getSignalVariance()
118  { return mSigma; };
119 
122 } //namespace bayesopt
123 
124 #endif
virtual void updateSurrogateModel()=0
Sequential update of the surrogate model by adding a new row to the Kernel matrix, more precisely, to its Cholesky decomposition.
Dataset model.
static NonParametricProcess * create(size_t dim, Parameters parameters, const Dataset &data, MeanModel &mean, randEngine &eng)
Factory model generator for surrogate models.
Namespace of the library interface.
Definition: using.dox:1
Abstract class to implement Bayesian regressors.
Interface for probability models.
Abstract class for optimizable objects.
Dataset model to deal with the vector (real) based datasets.
Definition: dataset.hpp:40
virtual ProbabilityDistribution * prediction(const vectord &query)=0
Function that returns the prediction of the GP for a query point in the hypercube [0...
virtual void fitSurrogateModel()=0
Computes the initial surrogate model and updates the kernel parameters estimation.
Mean (parametric) functions.