BayesOpt
posteriormodel.hpp
Go to the documentation of this file.
1
2
/*
3
-------------------------------------------------------------------------
4
This file is part of BayesOpt, an efficient C++ library for
5
Bayesian optimization.
6
7
Copyright (C) 2011-2015 Ruben Martinez-Cantin <rmcantin@unizar.es>
8
9
BayesOpt is free software: you can redistribute it and/or modify it
10
under the terms of the GNU Affero General Public License as published by
11
the Free Software Foundation, either version 3 of the License, or
12
(at your option) any later version.
13
14
BayesOpt is distributed in the hope that it will be useful, but
15
WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU Affero General Public License for more details.
18
19
You should have received a copy of the GNU Affero General Public License
20
along with BayesOpt. If not, see <http://www.gnu.org/licenses/>.
21
------------------------------------------------------------------------
22
*/
23
24
25
#ifndef _POSTERIORMODEL_HPP_
26
#define _POSTERIORMODEL_HPP_
27
28
#include "
prob_distribution.hpp
"
29
#include "
dataset.hpp
"
30
#include "
mean_functors.hpp
"
31
32
namespace
bayesopt
{
33
38
43
class
PosteriorModel
44
{
45
public
:
46
static
PosteriorModel
* create(
size_t
dim,
Parameters
params,
47
randEngine& eng);
48
53
PosteriorModel
(
size_t
dim,
Parameters
params, randEngine& eng);
54
58
virtual
~PosteriorModel
();
59
60
61
virtual
void
updateHyperParameters() = 0;
62
virtual
void
fitSurrogateModel() = 0;
63
virtual
void
updateSurrogateModel() = 0;
64
65
virtual
double
evaluateCriteria(
const
vectord& query) = 0;
66
virtual
void
updateCriteria(
const
vectord& query) = 0;
67
68
virtual
bool
criteriaRequiresComparison() = 0;
69
virtual
void
setFirstCriterium() = 0;
70
virtual
bool
setNextCriterium(
const
vectord& prevResult) = 0;
71
virtual
std::string getBestCriteria(vectord& best) = 0;
72
73
74
void
setSamples(
const
matrixd &x,
const
vectord &y);
75
void
setSamples(
const
matrixd &x);
76
void
setSamples(
const
vectord &y);
77
void
setSample(
const
vectord &x,
double
y);
78
void
addSample(
const
vectord &x,
double
y);
79
double
getValueAtMinimum();
80
vectord getPointAtMinimum();
81
82
void
plotDataset(TLogLevel level);
83
84
const
Dataset
* getData();
85
virtual
ProbabilityDistribution
* getPrediction(
const
vectord& query) = 0;
86
87
88
protected
:
89
Parameters
mParameters
;
90
size_t
mDims
;
91
Dataset
mData
;
92
MeanModel
mMean;
93
94
private
:
95
PosteriorModel
();
96
};
97
98
inline
vectord PosteriorModel::getPointAtMinimum()
99
{
return
mData
.getPointAtMinimum(); };
100
101
inline
double
PosteriorModel::getValueAtMinimum()
102
{
return
mData
.getValueAtMinimum(); };
103
104
inline
void
PosteriorModel::plotDataset(TLogLevel level)
105
{
mData
.plotData(level); }
106
107
inline
const
Dataset
* PosteriorModel::getData()
108
{
return
&
mData
; }
109
110
}
//namespace bayesopt
111
112
113
#endif
bayesopt::Parameters
Definition:
parameters.hpp:61
dataset.hpp
Dataset model.
bayesopt
Namespace of the library interface.
Definition:
using.dox:1
bayesopt::PosteriorModel::mParameters
Parameters mParameters
Configuration parameters.
Definition:
posteriormodel.hpp:89
prob_distribution.hpp
Interface for probability models.
bayesopt::PosteriorModel::mDims
size_t mDims
Number of dimensions.
Definition:
posteriormodel.hpp:90
bayesopt::Dataset
Dataset model to deal with the vector (real) based datasets.
Definition:
dataset.hpp:40
bayesopt::MeanModel
Definition:
mean_functors.hpp:116
bayesopt::PosteriorModel::mData
Dataset mData
Dataset (x-> inputs, y-> labels/output)
Definition:
posteriormodel.hpp:91
bayesopt::PosteriorModel
Bayesian optimization using different non-parametric processes as distributions over surrogate functi...
Definition:
posteriormodel.hpp:43
bayesopt::ProbabilityDistribution
Definition:
prob_distribution.hpp:35
mean_functors.hpp
Mean (parametric) functions.
bayesopt::PosteriorModel::~PosteriorModel
virtual ~PosteriorModel()
Default destructor.
Definition:
posteriormodel.cpp:51
include
posteriormodel.hpp
Generated on Fri May 15 2020 01:58:41 for BayesOpt by
1.8.13