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

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().

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

Copy constructor.

Parameters
otheroptimizer to be copied
sgpp::optimization::optimizer::NelderMead::~NelderMead ( )
override

Destructor.

Member Function Documentation

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().

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

References alpha.

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

References beta.

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

References delta.

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

References gamma.

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().

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

References alpha.

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

References beta.

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

References delta.

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

References gamma.

Member Data Documentation

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

expansion coefficient

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

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

default reflection coefficient

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

default expansion coefficient

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

default shrinking coefficient

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

default contraction coefficient

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

default maximal number of function evaluations

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

shrinking coefficient

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

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

contraction coefficient

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

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: