SG++-Doxygen-Documentation
|
Gradient-free Nelder-Mead method. More...
#include <NelderMead.hpp>
Public Member Functions | |
void | clone (std::unique_ptr< UnconstrainedOptimizer > &clone) const override |
double | getAlpha () const |
double | getBeta () const |
double | getDelta () const |
double | getGamma () const |
NelderMead (const ScalarFunction &f, size_t maxFcnEvalCount=DEFAULT_MAX_FCN_EVAL_COUNT, double alpha=DEFAULT_ALPHA, double beta=DEFAULT_BETA, double gamma=DEFAULT_GAMMA, double delta=DEFAULT_DELTA) | |
Constructor. More... | |
NelderMead (const NelderMead &other) | |
Copy constructor. More... | |
void | optimize () override |
Pure virtual method for optimization of the objective function. More... | |
void | setAlpha (double alpha) |
void | setBeta (double beta) |
void | setDelta (double delta) |
void | setGamma (double gamma) |
~NelderMead () 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 constexpr double | DEFAULT_ALPHA = 1.0 |
default reflection coefficient More... | |
static constexpr double | DEFAULT_BETA = 2.0 |
default expansion coefficient More... | |
static constexpr double | DEFAULT_DELTA = 0.5 |
default shrinking coefficient More... | |
static constexpr double | DEFAULT_GAMMA = 0.5 |
default contraction coefficient More... | |
static const size_t | DEFAULT_MAX_FCN_EVAL_COUNT = 1000 |
default maximal number of function evaluations More... | |
static constexpr double | STARTING_SIMPLEX_EDGE_LENGTH = 0.4 |
edge length of starting simplex 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 Attributes | |
double | alpha |
reflection coefficient More... | |
double | beta |
expansion coefficient More... | |
double | delta |
shrinking coefficient More... | |
double | gamma |
contraction coefficient 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... | |
Gradient-free Nelder-Mead method.
sgpp::optimization::optimizer::NelderMead::NelderMead | ( | const ScalarFunction & | f, |
size_t | maxFcnEvalCount = DEFAULT_MAX_FCN_EVAL_COUNT , |
||
double | alpha = DEFAULT_ALPHA , |
||
double | beta = DEFAULT_BETA , |
||
double | gamma = DEFAULT_GAMMA , |
||
double | delta = DEFAULT_DELTA |
||
) |
Constructor.
The starting point is set to \((0.5, \dotsc, 0.5)^{\mathrm{T}}\).
f | objective function |
maxFcnEvalCount | maximal number of function evaluations |
alpha | reflection coefficient |
beta | expansion coefficient |
gamma | contraction coefficient |
delta | shrinking coefficient |
Referenced by clone().
sgpp::optimization::optimizer::NelderMead::NelderMead | ( | const NelderMead & | other | ) |
Copy constructor.
other | optimizer to be copied |
|
override |
Destructor.
|
overridevirtual |
[out] | clone | pointer to cloned object |
Implements sgpp::optimization::optimizer::UnconstrainedOptimizer.
References NelderMead().
Referenced by sgpp::optimization::optimizer::MultiStart::MultiStart().
double sgpp::optimization::optimizer::NelderMead::getAlpha | ( | ) | const |
References alpha.
double sgpp::optimization::optimizer::NelderMead::getBeta | ( | ) | const |
References beta.
double sgpp::optimization::optimizer::NelderMead::getDelta | ( | ) | const |
References delta.
double sgpp::optimization::optimizer::NelderMead::getGamma | ( | ) | const |
References gamma.
|
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 alpha, sgpp::base::DataVector::append(), sgpp::base::DataMatrix::appendRow(), chess::b, beta, delta, sgpp::optimization::optimizer::UnconstrainedOptimizer::f, sgpp::optimization::optimizer::UnconstrainedOptimizer::fHist, sgpp::optimization::optimizer::UnconstrainedOptimizer::fOpt, gamma, sgpp::optimization::Printer::getInstance(), python.statsfileInfo::i, sgpp::optimization::optimizer::UnconstrainedOptimizer::N, python.leja::points, sgpp::optimization::Printer::printStatusBegin(), sgpp::optimization::Printer::printStatusEnd(), sgpp::optimization::Printer::printStatusUpdate(), sgpp::base::DataMatrix::resize(), STARTING_SIMPLEX_EDGE_LENGTH, sgpp::optimization::optimizer::UnconstrainedOptimizer::x0, sgpp::optimization::optimizer::UnconstrainedOptimizer::xHist, and sgpp::optimization::optimizer::UnconstrainedOptimizer::xOpt.
Referenced by sgpp::datadriven::OperationInverseRosenblattTransformation1DBspline::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DModBspline::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DPoly::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DPolyBoundary::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DBsplineBoundary::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DModPoly::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DModPolyClenshawCurtis::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DBsplineClenshawCurtis::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DPolyClenshawCurtis::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DPolyClenshawCurtisBoundary::doTransformation1D(), sgpp::datadriven::OperationInverseRosenblattTransformation1DModBsplineClenshawCurtis::doTransformation1D(), and sgpp::datadriven::MaximumLikelihoodCrossValidation::optimizeBandwidths().
void sgpp::optimization::optimizer::NelderMead::setAlpha | ( | double | alpha | ) |
alpha | reflection coefficient |
References alpha.
void sgpp::optimization::optimizer::NelderMead::setBeta | ( | double | beta | ) |
beta | expansion coefficient |
References beta.
void sgpp::optimization::optimizer::NelderMead::setDelta | ( | double | delta | ) |
delta | shrinking coefficient |
References delta.
void sgpp::optimization::optimizer::NelderMead::setGamma | ( | double | gamma | ) |
gamma | contraction coefficient |
References gamma.
|
protected |
reflection coefficient
Referenced by getAlpha(), optimize(), python.learner.Classifier.Classifier::refineGrid(), and setAlpha().
|
protected |
expansion coefficient
Referenced by getBeta(), optimize(), and setBeta().
|
static |
default reflection coefficient
|
static |
default expansion coefficient
|
static |
default shrinking coefficient
|
static |
default contraction coefficient
|
static |
default maximal number of function evaluations
|
protected |
shrinking coefficient
Referenced by getDelta(), optimize(), and setDelta().
|
protected |
contraction coefficient
Referenced by getGamma(), optimize(), and setGamma().
|
static |
edge length of starting simplex
Referenced by optimize().