SG++-Doxygen-Documentation
|
Meta optimization algorithm calling local algorithm multiple times. More...
#include <MultiStart.hpp>
Public Member Functions | |
void | clone (std::unique_ptr< UnconstrainedOptimizer > &clone) const override |
const std::vector< size_t > & | getHistoryOfInnerIterations () const |
size_t | getPopulationSize () const |
MultiStart (const ScalarFunction &f, size_t maxFcnEvalCount=DEFAULT_MAX_FCN_EVAL_COUNT, size_t populationSize=0) | |
Constructor. More... | |
MultiStart (const UnconstrainedOptimizer &optimizer, size_t maxFcnEvalCount=DEFAULT_MAX_FCN_EVAL_COUNT, size_t populationSize=0) | |
Constructor with custom optimization algorithm. More... | |
MultiStart (const MultiStart &other) | |
Copy constructor. More... | |
void | optimize () override |
Pure virtual method for optimization of the objective function. More... | |
void | setPopulationSize (size_t populationSize) |
~MultiStart () override | |
Destructor. More... | |
Public Member Functions inherited from sgpp::optimization::optimizer::UnconstrainedOptimizer | |
const base::DataMatrix & | getHistoryOfOptimalPoints () const |
const base::DataVector & | getHistoryOfOptimalValues () const |
size_t | getN () const |
ScalarFunction & | getObjectiveFunction () const |
const base::DataVector & | getOptimalPoint () const |
double | getOptimalValue () const |
const base::DataVector & | getStartingPoint () const |
void | setN (size_t N) |
void | setStartingPoint (const base::DataVector &startingPoint) |
UnconstrainedOptimizer (const ScalarFunction &f, size_t N=DEFAULT_N) | |
Constructor. More... | |
UnconstrainedOptimizer (const UnconstrainedOptimizer &other) | |
Copy constructor. More... | |
virtual | ~UnconstrainedOptimizer () |
Destructor. More... | |
Static Public Attributes | |
static const size_t | DEFAULT_MAX_FCN_EVAL_COUNT = 1000 |
default maximal number of function evaluations More... | |
Static Public Attributes inherited from sgpp::optimization::optimizer::UnconstrainedOptimizer | |
static const size_t | DEFAULT_N = 1000 |
default maximal number of iterations or function evaluations More... | |
Protected Member Functions | |
void | initialize (size_t populationSize) |
Initializes populationSize. More... | |
Protected Attributes | |
NelderMead | defaultOptimizer |
default optimization algorithm More... | |
std::vector< size_t > | kHist |
search history (inner iterations) More... | |
std::unique_ptr< UnconstrainedOptimizer > | optimizer |
optimization algorithm More... | |
size_t | populationSize |
number of individual points More... | |
Protected Attributes inherited from sgpp::optimization::optimizer::UnconstrainedOptimizer | |
std::unique_ptr< ScalarFunction > | f |
objective function More... | |
base::DataVector | fHist |
search history vector (optimal values) More... | |
double | fOpt |
result of optimization (optimal function value) More... | |
size_t | N |
maximal number of iterations or function evaluations More... | |
base::DataVector | x0 |
starting point More... | |
base::DataMatrix | xHist |
search history matrix (optimal points) More... | |
base::DataVector | xOpt |
result of optimization (location of optimum) More... | |
Meta optimization algorithm calling local algorithm multiple times.
MultiStart generates a random population of a given number of starting points, and then runs a local optimization algorithm for each of the starting point. The best point wins.
sgpp::optimization::optimizer::MultiStart::MultiStart | ( | const ScalarFunction & | f, |
size_t | maxFcnEvalCount = DEFAULT_MAX_FCN_EVAL_COUNT , |
||
size_t | populationSize = 0 |
||
) |
Constructor.
By default, Nelder-Mead is used as optimization algorithm.
f | objective function |
maxFcnEvalCount | maximal number of function evaluations |
populationSize | number of individual points (default: \(\min(10d, 100)\)) |
References sgpp::optimization::optimizer::NelderMead::clone(), defaultOptimizer, initialize(), and optimizer.
Referenced by clone().
sgpp::optimization::optimizer::MultiStart::MultiStart | ( | const UnconstrainedOptimizer & | optimizer, |
size_t | maxFcnEvalCount = DEFAULT_MAX_FCN_EVAL_COUNT , |
||
size_t | populationSize = 0 |
||
) |
Constructor with custom optimization algorithm.
The current values of the optimizer's N and starting point properties will not be used.
optimizer | optimization algorithm and objective function |
maxFcnEvalCount | maximal number of function evaluations |
populationSize | number of individual points (default: \(\min(10d, 100)\)) |
References sgpp::optimization::optimizer::UnconstrainedOptimizer::clone(), and initialize().
sgpp::optimization::optimizer::MultiStart::MultiStart | ( | const MultiStart & | other | ) |
Copy constructor.
other | optimizer to be copied |
References initialize(), optimizer, and populationSize.
|
override |
Destructor.
|
overridevirtual |
[out] | clone | pointer to cloned object |
Implements sgpp::optimization::optimizer::UnconstrainedOptimizer.
References MultiStart().
const std::vector< size_t > & sgpp::optimization::optimizer::MultiStart::getHistoryOfInnerIterations | ( | ) | const |
References kHist.
size_t sgpp::optimization::optimizer::MultiStart::getPopulationSize | ( | ) | const |
References populationSize.
|
protected |
Initializes populationSize.
populationSize | number of individual points (zero to use default value) |
References sgpp::optimization::optimizer::UnconstrainedOptimizer::f.
Referenced by MultiStart().
|
overridevirtual |
Pure virtual method for optimization of the objective function.
The result of the optimization process can be obtained by member functions, e.g., getOptimalPoint() and getOptimalValue().
Implements sgpp::optimization::optimizer::UnconstrainedOptimizer.
References sgpp::base::DataVector::append(), sgpp::base::DataMatrix::appendRow(), sgpp::optimization::Printer::disableStatusPrinting(), sgpp::optimization::Printer::enableStatusPrinting(), sgpp::optimization::optimizer::UnconstrainedOptimizer::f, sgpp::optimization::optimizer::UnconstrainedOptimizer::fHist, sgpp::optimization::optimizer::UnconstrainedOptimizer::fOpt, sgpp::optimization::optimizer::UnconstrainedOptimizer::getHistoryOfOptimalPoints(), sgpp::optimization::RandomNumberGenerator::getInstance(), sgpp::optimization::Printer::getInstance(), sgpp::optimization::Printer::getMutex(), sgpp::base::DataMatrix::getNrows(), sgpp::optimization::optimizer::UnconstrainedOptimizer::getOptimalPoint(), sgpp::optimization::optimizer::UnconstrainedOptimizer::getOptimalValue(), sgpp::optimization::RandomNumberGenerator::getUniformRN(), sgpp::optimization::Printer::isStatusPrintingEnabled(), kHist, sgpp::optimization::MutexType::lock(), sgpp::optimization::optimizer::UnconstrainedOptimizer::N, sgpp::optimization::optimizer::UnconstrainedOptimizer::optimize(), optimizer, populationSize, sgpp::optimization::Printer::printStatusBegin(), sgpp::optimization::Printer::printStatusEnd(), sgpp::optimization::Printer::printStatusUpdate(), sgpp::base::DataMatrix::resize(), sgpp::optimization::optimizer::UnconstrainedOptimizer::setN(), sgpp::optimization::optimizer::UnconstrainedOptimizer::setStartingPoint(), sgpp::optimization::MutexType::unlock(), sgpp::optimization::optimizer::UnconstrainedOptimizer::x0, sgpp::optimization::optimizer::UnconstrainedOptimizer::xHist, and sgpp::optimization::optimizer::UnconstrainedOptimizer::xOpt.
Referenced by sgpp::datadriven::BayesianOptimization::main().
void sgpp::optimization::optimizer::MultiStart::setPopulationSize | ( | size_t | populationSize | ) |
populationSize | number of individual points |
References populationSize.
|
static |
default maximal number of function evaluations
|
protected |
default optimization algorithm
Referenced by MultiStart().
|
protected |
search history (inner iterations)
Referenced by getHistoryOfInnerIterations(), and optimize().
|
protected |
optimization algorithm
Referenced by MultiStart(), and optimize().
|
protected |
number of individual points
Referenced by getPopulationSize(), MultiStart(), optimize(), and setPopulationSize().