BayesOpt
conditionalbayesprocess.hpp
Go to the documentation of this file.
1 
4 /*
5 -------------------------------------------------------------------------
6  This file is part of BayesOpt, an efficient C++ library for
7  Bayesian optimization.
8 
9  Copyright (C) 2011-2015 Ruben Martinez-Cantin <rmcantin@unizar.es>
10 
11  BayesOpt is free software: you can redistribute it and/or modify it
12  under the terms of the GNU Affero General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  BayesOpt is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU Affero General Public License for more details.
20 
21  You should have received a copy of the GNU Affero General Public License
22  along with BayesOpt. If not, see <http://www.gnu.org/licenses/>.
23 ------------------------------------------------------------------------
24 */
25 
26 
27 #ifndef _CONDITIONAL_BAYES_PROCESS_HPP_
28 #define _CONDITIONAL_BAYES_PROCESS_HPP_
29 
30 #include "kernelregressor.hpp"
31 
32 namespace bayesopt
33 {
34 
43  {
44  public:
45  ConditionalBayesProcess(size_t dim, Parameters parameters,
46  const Dataset& data,
47  MeanModel& mean, randEngine& eng);
48  virtual ~ConditionalBayesProcess();
49 
57  virtual ProbabilityDistribution* prediction(const vectord &query) = 0;
58 
66  double evaluate(const vectord &x);
67 
74  double evaluateKernelParams();
75 
76 
77  protected:
83  virtual double negativeTotalLogLikelihood() = 0;
84 
85 
91  virtual double negativeLogLikelihood() = 0;
92 
93  private:
98  double negativeCrossValidation();
99 
100  };
101 
102 
103  // WARNING!! evaluateKernelParams models return the NEGATIVE
104  // log-score (likelihood, LOO, MAP, etc.).
105  inline double ConditionalBayesProcess::evaluate(const vectord& x)
106  {
107  setHyperParameters(x);
108  return evaluateKernelParams();
109  };
110 
111 
114 } //namespace bayesopt
115 
116 #endif
117 
virtual ProbabilityDistribution * prediction(const vectord &query)=0
Function that returns the prediction of the GP for a query point in the hypercube [0...
virtual double negativeLogLikelihood()=0
Computes the negative log likelihood of the data for the kernel hyperparameters.
Namespace of the library interface.
Definition: using.dox:1
double evaluate(const vectord &x)
Computes the score (eg:likelihood) of the kernel parameters.
Empirical Bayesian NonParametric process.
Dataset model to deal with the vector (real) based datasets.
Definition: dataset.hpp:40
double evaluateKernelParams()
Computes the score (eg:likelihood) of the current kernel parameters.
Abstract class to implement non-parametric processes.
double negativeCrossValidation()
Computes the negative score of the data using cross validation.
virtual double negativeTotalLogLikelihood()=0
Computes the negative log likelihood of the data for all the parameters.
Nonparametric process abstract module.