26 #ifndef _BAYESOPTBASE_HPP_ 27 #define _BAYESOPTBASE_HPP_ 29 #include <boost/scoped_ptr.hpp> 30 #include <boost/random.hpp> 31 #include <boost/numeric/ublas/vector.hpp> 32 #include <boost/numeric/ublas/matrix.hpp> 33 #include <boost/numeric/ublas/io.hpp> 45 class ProbabilityDistribution;
49 typedef boost::numeric::ublas::vector<double> vectord;
50 typedef boost::numeric::ublas::vector<int> vectori;
51 typedef boost::numeric::ublas::matrix<double> matrixd;
52 typedef std::vector<vectord> vecOfvec;
94 virtual double evaluateSample(
const vectord &query ) = 0;
126 void optimize(vectord &bestPoint);
132 void stepOptimization();
135 void initializeOptimization();
138 vectord getFinalResult();
144 void restoreOptimization(
BOptState state);
150 double getValueAtMinimum();
151 size_t getCurrentIter();
152 double evaluateCriteria(
const vectord& query);
156 vectord getPointAtMinimum();
161 double evaluateSampleInternal(
const vectord &query );
165 virtual vectord samplePoint() = 0;
172 virtual void findOptimal(vectord &xOpt) = 0;
176 virtual vectord remapPoint(
const vectord& x) = 0;
179 virtual void generateInitialPoints(matrixd& xPoints) = 0;
188 void plotStepData(
size_t iteration,
const vectord& xNext,
192 void saveInitialSamples(matrixd xPoints);
193 void saveResponse(
double yPoint,
bool clear);
202 boost::scoped_ptr<PosteriorModel> mModel;
204 size_t mCounterStuck;
Class that represents the state of an optimization.
Namespace of the library interface.
virtual bool checkReachability(const vectord &query)
This function checks if the query is valid or not.
boost::mt19937 mEngine
Random number generator.
Parameters mParameters
Configuration parameters.
size_t mDims
Number of dimensions.
Abstract module for Bayesian optimization.
Dataset model to deal with the vector (real) based datasets.
size_t mCurrentIter
Current iteration number.