SG++-Doxygen-Documentation
sgpp::optimization::optimizer::NelderMead Class Reference

Gradient-free Nelder-Mead method. More...

#include <NelderMead.hpp>

Inheritance diagram for sgpp::optimization::optimizer::NelderMead:
sgpp::optimization::optimizer::UnconstrainedOptimizer

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::DataMatrixgetHistoryOfOptimalPoints () const
 
const base::DataVectorgetHistoryOfOptimalValues () const
 
size_t getN () const
 
ScalarFunctiongetObjectiveFunction () const
 
const base::DataVectorgetOptimalPoint () const
 
double getOptimalValue () const
 
const base::DataVectorgetStartingPoint () 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< ScalarFunctionf
 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...
 

Detailed Description

Gradient-free Nelder-Mead method.

Constructor & Destructor Documentation

◆ NelderMead() [1/2]

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}}\).

Parameters
fobjective function
maxFcnEvalCountmaximal number of function evaluations
alphareflection coefficient
betaexpansion coefficient
gammacontraction coefficient
deltashrinking coefficient

Referenced by clone().

◆ NelderMead() [2/2]

sgpp::optimization::optimizer::NelderMead::NelderMead ( const NelderMead other)

Copy constructor.

Parameters
otheroptimizer to be copied

◆ ~NelderMead()

sgpp::optimization::optimizer::NelderMead::~NelderMead ( )
override

Destructor.

Member Function Documentation

◆ clone()

void sgpp::optimization::optimizer::NelderMead::clone ( std::unique_ptr< UnconstrainedOptimizer > &  clone) const
overridevirtual
Parameters
[out]clonepointer to cloned object

Implements sgpp::optimization::optimizer::UnconstrainedOptimizer.

References NelderMead().

Referenced by sgpp::optimization::optimizer::MultiStart::MultiStart().

◆ getAlpha()

double sgpp::optimization::optimizer::NelderMead::getAlpha ( ) const
Returns
reflection coefficient

References alpha.

◆ getBeta()

double sgpp::optimization::optimizer::NelderMead::getBeta ( ) const
Returns
expansion coefficient

References beta.

◆ getDelta()

double sgpp::optimization::optimizer::NelderMead::getDelta ( ) const
Returns
shrinking coefficient

References delta.

◆ getGamma()

double sgpp::optimization::optimizer::NelderMead::getGamma ( ) const
Returns
contraction coefficient

References gamma.

◆ optimize()

void sgpp::optimization::optimizer::NelderMead::optimize ( )
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().

◆ setAlpha()

void sgpp::optimization::optimizer::NelderMead::setAlpha ( double  alpha)
Parameters
alphareflection coefficient

References alpha.

◆ setBeta()

void sgpp::optimization::optimizer::NelderMead::setBeta ( double  beta)
Parameters
betaexpansion coefficient

References beta.

◆ setDelta()

void sgpp::optimization::optimizer::NelderMead::setDelta ( double  delta)
Parameters
deltashrinking coefficient

References delta.

◆ setGamma()

void sgpp::optimization::optimizer::NelderMead::setGamma ( double  gamma)
Parameters
gammacontraction coefficient

References gamma.

Member Data Documentation

◆ alpha

double sgpp::optimization::optimizer::NelderMead::alpha
protected

◆ beta

double sgpp::optimization::optimizer::NelderMead::beta
protected

expansion coefficient

Referenced by getBeta(), optimize(), and setBeta().

◆ DEFAULT_ALPHA

constexpr double sgpp::optimization::optimizer::NelderMead::DEFAULT_ALPHA = 1.0
static

default reflection coefficient

◆ DEFAULT_BETA

constexpr double sgpp::optimization::optimizer::NelderMead::DEFAULT_BETA = 2.0
static

default expansion coefficient

◆ DEFAULT_DELTA

constexpr double sgpp::optimization::optimizer::NelderMead::DEFAULT_DELTA = 0.5
static

default shrinking coefficient

◆ DEFAULT_GAMMA

constexpr double sgpp::optimization::optimizer::NelderMead::DEFAULT_GAMMA = 0.5
static

default contraction coefficient

◆ DEFAULT_MAX_FCN_EVAL_COUNT

const size_t sgpp::optimization::optimizer::NelderMead::DEFAULT_MAX_FCN_EVAL_COUNT = 1000
static

default maximal number of function evaluations

◆ delta

double sgpp::optimization::optimizer::NelderMead::delta
protected

shrinking coefficient

Referenced by getDelta(), optimize(), and setDelta().

◆ gamma

double sgpp::optimization::optimizer::NelderMead::gamma
protected

contraction coefficient

Referenced by getGamma(), optimize(), and setGamma().

◆ STARTING_SIMPLEX_EDGE_LENGTH

constexpr double sgpp::optimization::optimizer::NelderMead::STARTING_SIMPLEX_EDGE_LENGTH = 0.4
static

edge length of starting simplex

Referenced by optimize().


The documentation for this class was generated from the following files: