BayesOpt
|
Bayesian optimization for functions in discrete spaces. More...
#include <bayesopt.hpp>
Public Member Functions | |
DiscreteModel (const vecOfvec &validSet, Parameters params) | |
Constructor for real-valued discrete data. More... | |
DiscreteModel (const vectori &categories, Parameters params) | |
Constructor for categorical data. More... | |
virtual | ~DiscreteModel () |
Default destructor. | |
Public Member Functions inherited from bayesopt::BayesOptBase | |
BayesOptBase (size_t dim, Parameters params) | |
Constructor. More... | |
virtual | ~BayesOptBase () |
Default destructor. | |
virtual double | evaluateSample (const vectord &query)=0 |
Function that defines the actual function to be optimized. More... | |
virtual bool | checkReachability (const vectord &query) |
This function checks if the query is valid or not. More... | |
void | optimize (vectord &bestPoint) |
Execute the optimization process of the function defined in evaluateSample. More... | |
void | stepOptimization () |
Execute ONE step the optimization process of the function defined in evaluateSample. | |
void | initializeOptimization () |
Initialize the optimization process. More... | |
vectord | getFinalResult () |
Once the optimization has been perfomed, return the optimal point. More... | |
void | saveOptimization (BOptState &state) |
Saves the current state of the optimization process into a state class. More... | |
void | restoreOptimization (BOptState state) |
Restores the optimization process of a previous execution. | |
ProbabilityDistribution * | getPrediction (const vectord &query) |
const Dataset * | getData () |
Parameters * | getParameters () |
double | getValueAtMinimum () |
size_t | getCurrentIter () |
double | evaluateCriteria (const vectord &query) |
Protected Member Functions | |
vectord | samplePoint () |
Sample a single point in the input space. More... | |
void | findOptimal (vectord &xOpt) |
Call the inner optimization method to find the optimal point acording to the criteria. More... | |
vectord | remapPoint (const vectord &x) |
Remap the point x to the original space. | |
void | generateInitialPoints (matrixd &xPoints) |
Selects the initial set of points to build the surrogate model. More... | |
Protected Member Functions inherited from bayesopt::BayesOptBase | |
vectord | getPointAtMinimum () |
Get optimal point in the inner space (e.g. More... | |
double | evaluateSampleInternal (const vectord &query) |
Wrapper for the target function adding any preprocessing or constraint. More... | |
void | plotStepData (size_t iteration, const vectord &xNext, double yNext) |
Print data for every step according to the verbose level. More... | |
void | saveInitialSamples (matrixd xPoints) |
Eases the process of saving a state during initial samples. | |
void | saveResponse (double yPoint, bool clear) |
Private Member Functions | |
DiscreteModel () | |
Default constructor forbidden. | |
Private Attributes | |
vecOfvec | mInputSet |
List of input points. | |
Additional Inherited Members | |
Protected Attributes inherited from bayesopt::BayesOptBase | |
Parameters | mParameters |
Configuration parameters. | |
size_t | mDims |
Number of dimensions. | |
size_t | mCurrentIter |
Current iteration number. | |
boost::mt19937 | mEngine |
Random number generator. | |
Bayesian optimization for functions in discrete spaces.
The discrete space can be created in two ways depending on the constructor used:
The kind of models used in this library are more suitable for problems of the first point. However, it can also be used with problems in the second category. In that case, we recommend to use the Hamming kernel function.
Usage:
Optimization can be run in batch mode calling
or step by step.
Definition at line 166 of file bayesopt.hpp.
bayesopt::DiscreteModel::DiscreteModel | ( | const vecOfvec & | validSet, |
Parameters | params | ||
) |
Constructor for real-valued discrete data.
validSet | Set of potential inputs |
params | set of parameters (see parameters.h) |
Definition at line 42 of file bayesoptdisc.cpp.
References bayesopt::BayesOptBase::mDims, and mInputSet.
bayesopt::DiscreteModel::DiscreteModel | ( | const vectori & | categories, |
Parameters | params | ||
) |
Constructor for categorical data.
number | of categories per dimension |
params | set of parameters (see parameters.h) |
Definition at line 49 of file bayesoptdisc.cpp.
References bayesopt::BayesOptBase::mDims, and mInputSet.
|
protectedvirtual |
Call the inner optimization method to find the optimal point acording to the criteria.
xOpt | optimal point |
Implements bayesopt::BayesOptBase.
Definition at line 70 of file bayesoptdisc.cpp.
References mInputSet.
|
protectedvirtual |
Selects the initial set of points to build the surrogate model.
Implements bayesopt::BayesOptBase.
Definition at line 98 of file bayesoptdisc.cpp.
References bayesopt::BayesOptBase::mEngine, mInputSet, and bayesopt::utils::randomPerms().
|
protectedvirtual |
Sample a single point in the input space.
Used for epsilon greedy exploration.
Implements bayesopt::BayesOptBase.
Definition at line 64 of file bayesoptdisc.cpp.
References bayesopt::BayesOptBase::mEngine.