BayesOpt
|
Extra utils: math functions, ublas helpers, etc. More...
Classes | |
class | BoundingBox |
Defines a bounding box or axis-alligned bound constraints. More... | |
class | CUnique |
Simple class to generate sequences of unique numbers. More... | |
class | DisplayProblem1D |
class | DisplayProblem2D |
class | FileParser |
class | ParamLoader |
Enumerations | |
enum | RunningStatus { RUN, STEP, STOP, NOT_READY } |
Functions | |
void | deepenGrid (size_t comp, const vectori ndivs, vectord &x, vecOfvec &result) |
void | buildGrid (const vectori &dims, vecOfvec &result) |
std::vector< int > | return_index_vector (size_t n) |
Generates a vector of indexes (1..n) More... | |
std::vector< int > | return_index_vector (int a, size_t n) |
Generates a vector of indexes starting at A and size_t n. More... | |
void | modify_index_vector (std::vector< int > &arr) |
Modify a vector of indexes (0..n) More... | |
template<class M > | |
void | samplePoints (M &xPoints, int method, randEngine &mtRandom) |
Selects the sampling method. More... | |
template<class M > | |
void | lhs (M &Result, randEngine &mtRandom) |
Latin hypercube sampling It is used to generate a uniform Latin hypercube. | |
template<class M > | |
void | uniformSampling (M &Result, randEngine &mtRandom) |
Hypercube sampling based on Sobol sequences It uses the external Sobol library. More... | |
template<class D > | |
void | randomPerms (D &arr, randEngine &mtRandom) |
Modify an array using ramdom permutations. More... | |
void | parseExpresion (std::string input, std::string &parent, std::string &child1, std::string &child2) |
Parse expresions of the form Parent(Child1, Child2). More... | |
void | parseExpresion (std::string input, std::string &parent, std::vector< std::string > &childs) |
Parse expresions of the form Parent(Child1, ... More... | |
void | split (std::string &input, char delim, std::vector< std::string > &elems) |
Splits the input string with a delimiter to extract elements. | |
template<class MATRIX , class TRIA > | |
size_t | cholesky_decompose (const MATRIX &A, TRIA &L) |
decompose the symmetric positive definit matrix A into product L L^T. More... | |
template<class MATRIX > | |
size_t | cholesky_decompose (MATRIX &A) |
decompose the symmetric positive definit matrix A into product L L^T. More... | |
template<class MATRIX > | |
size_t | incomplete_cholesky_decompose (MATRIX &A) |
decompose the symmetric positive definit matrix A into product L L^T. More... | |
template<class TRIA , class MATRIX > | |
void | cholesky_solve (const TRIA &L, MATRIX &x, ublas::lower) |
solve system L L^T x = b inplace More... | |
template<class Min , class Mout > | |
size_t | inverse_cholesky (const Min &M, Mout &inverse) |
Computes the inverse matrix of a symmetric positive definite matrix. More... | |
template<class TRIA , class VECTOR > | |
void | cholesky_add_row (TRIA &L, const VECTOR &v) |
decompose the symmetric positive definit matrix A into product L L^T. More... | |
template<class v1 , class v2 > | |
v1 | ublas_elementwise_prod (const v1 &a, const v2 &b) |
Computes the elementwise product of two vectors or matrices. More... | |
template<class v1 , class v2 > | |
v1 | ublas_elementwise_div (const v1 &a, const v2 &b) |
Computes the elementwise division of two vectors or matrices. More... | |
boost::numeric::ublas::vector< double > | array2vector (const double array[], const size_t n) |
template<class V , class D > | |
void | append (V &vect, D element) |
template<class V , class I > | |
void | erase (V &vect, I begin) |
template<class M > | |
void | erase_column (M &mat, size_t pos) |
template<class M , class V > | |
void | add_to_diagonal (M &mat, const V &vec) |
template<class E > | |
E::value_type | trace (const E &A) |
template<class E > | |
E::value_type | log_trace (const E &A) |
template<class E1 , class E2 > | |
E1::value_type | trace_prod (const E1 &A, const E2 &B) |
Extra utils: math functions, ublas helpers, etc.
void bayesopt::utils::cholesky_add_row | ( | TRIA & | L, |
const VECTOR & | v | ||
) |
decompose the symmetric positive definit matrix A into product L L^T.
MATRIX | type of input matrix |
TRIA | type of lower triangular output matrix |
A | square symmetric positive definite input matrix (only the lower triangle is accessed) |
L | lower triangular output matrix |
Definition at line 264 of file ublas_cholesky.hpp.
Referenced by bayesopt::KernelRegressor::addNewPointToCholesky(), and bayesopt::KernelRegressor::updateSurrogateModel().
size_t bayesopt::utils::cholesky_decompose | ( | const MATRIX & | A, |
TRIA & | L | ||
) |
decompose the symmetric positive definit matrix A into product L L^T.
MATRIX | type of input matrix |
TRIA | type of lower triangular output matrix |
A | square symmetric positive definite input matrix (only the lower triangle is accessed) |
L | lower triangular output matrix |
Definition at line 57 of file ublas_cholesky.hpp.
Referenced by bayesopt::KernelRegressor::computeCholeskyCorrelation(), inverse_cholesky(), bayesopt::GaussianProcess::negativeLogLikelihood(), bayesopt::HierarchicalGaussianProcess::negativeTotalLogLikelihood(), bayesopt::StudentTProcessJeffreys::precomputePrediction(), and bayesopt::GaussianProcessML::precomputePrediction().
size_t bayesopt::utils::cholesky_decompose | ( | MATRIX & | A | ) |
decompose the symmetric positive definit matrix A into product L L^T.
MATRIX | type of matrix A |
A | input: square symmetric positive definite matrix (only the lower triangle is accessed) |
A | output: the lower triangle of A is replaced by the cholesky factor |
Definition at line 99 of file ublas_cholesky.hpp.
void bayesopt::utils::cholesky_solve | ( | const TRIA & | L, |
MATRIX & | x, | ||
ublas::lower | |||
) |
solve system L L^T x = b inplace
L | a triangular matrix |
x | input: right hand side b; output: solution x |
Definition at line 222 of file ublas_cholesky.hpp.
Referenced by inverse_cholesky(), bayesopt::HierarchicalGaussianProcess::negativeTotalLogLikelihood(), bayesopt::StudentTProcessJeffreys::precomputePrediction(), and bayesopt::GaussianProcessML::precomputePrediction().
size_t bayesopt::utils::incomplete_cholesky_decompose | ( | MATRIX & | A | ) |
decompose the symmetric positive definit matrix A into product L L^T.
MATRIX | type of matrix A |
A | input: square symmetric positive definite matrix (only the lower triangle is accessed) |
A | output: the lower triangle of A is replaced by the cholesky factor |
Definition at line 175 of file ublas_cholesky.hpp.
size_t bayesopt::utils::inverse_cholesky | ( | const Min & | M, |
Mout & | inverse | ||
) |
Computes the inverse matrix of a symmetric positive definite matrix.
M | original matrix |
inverse | inverse of M |
Definition at line 240 of file ublas_cholesky.hpp.
References cholesky_decompose(), and cholesky_solve().
|
inline |
Modify a vector of indexes (0..n)
arr | vector |
Definition at line 77 of file indexvector.hpp.
void bayesopt::utils::parseExpresion | ( | std::string | input, |
std::string & | parent, | ||
std::string & | child1, | ||
std::string & | child2 | ||
) |
Parse expresions of the form Parent(Child1, Child2).
The "childs" can also be expressions of the same type.
Definition at line 35 of file parser.cpp.
Referenced by bayesopt::KernelFactory::create(), bayesopt::CriteriaFactory::create(), and bayesopt::MeanFactory::create().
void bayesopt::utils::parseExpresion | ( | std::string | input, |
std::string & | parent, | ||
std::vector< std::string > & | childs | ||
) |
Parse expresions of the form Parent(Child1, ...
,ChildN). The "childs" can also be expressions of the same type.
Definition at line 70 of file parser.cpp.
void bayesopt::utils::randomPerms | ( | D & | arr, |
randEngine & | mtRandom | ||
) |
Modify an array using ramdom permutations.
It is used to generate a uniform Latin hypercube. Equivalent to std::random_shuffle but using boost::random
Definition at line 80 of file lhs.hpp.
Referenced by bayesopt::DiscreteModel::generateInitialPoints().
|
inline |
Generates a vector of indexes (1..n)
n | vector size |
Definition at line 50 of file indexvector.hpp.
|
inline |
Generates a vector of indexes starting at A and size_t n.
a | starting point |
n | vector size |
Definition at line 64 of file indexvector.hpp.
void bayesopt::utils::samplePoints | ( | M & | xPoints, |
int | method, | ||
randEngine & | mtRandom | ||
) |
Selects the sampling method.
Definition at line 141 of file lhs.hpp.
Referenced by bayesopt::ContinuousModel::generateInitialPoints().
v1 bayesopt::utils::ublas_elementwise_div | ( | const v1 & | a, |
const v2 & | b | ||
) |
Computes the elementwise division of two vectors or matrices.
c_i = a_i / b_i
Definition at line 53 of file ublas_elementwise.hpp.
v1 bayesopt::utils::ublas_elementwise_prod | ( | const v1 & | a, |
const v2 & | b | ||
) |
Computes the elementwise product of two vectors or matrices.
c_i = a_i * b_i
Definition at line 40 of file ublas_elementwise.hpp.
void bayesopt::utils::uniformSampling | ( | M & | Result, |
randEngine & | mtRandom | ||
) |