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

Gradient-based nonlinear conjugate gradient method. More...

#include <Newton.hpp>

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

Public Member Functions

void clone (std::unique_ptr< UnconstrainedOptimizer > &clone) const override
 
double getAlpha1 () const
 
double getAlpha2 () const
 
double getBeta () const
 
double getEpsilon () const
 
double getGamma () const
 
ScalarFunctionHessiangetObjectiveHessian () const
 
double getP () const
 
double getTolerance () const
 
 Newton (const ScalarFunction &f, const ScalarFunctionHessian &fHessian, size_t maxItCount=DEFAULT_N, double beta=DEFAULT_BETA, double gamma=DEFAULT_GAMMA, double tolerance=DEFAULT_TOLERANCE, double epsilon=DEFAULT_EPSILON, double alpha1=DEFAULT_ALPHA1, double alpha2=DEFAULT_ALPHA2, double p=DEFAULT_P)
 Constructor. More...
 
 Newton (const ScalarFunction &f, const ScalarFunctionHessian &fHessian, size_t maxItCount, double beta, double gamma, double tolerance, double epsilon, double alpha1, double alpha2, double p, const sle_solver::SLESolver &sleSolver)
 Constructor. More...
 
 Newton (const Newton &other)
 Copy constructor. More...
 
void optimize () override
 Pure virtual method for optimization of the objective function. More...
 
void setAlpha1 (double alpha1)
 
void setAlpha2 (double alpha2)
 
void setBeta (double beta)
 
void setEpsilon (double epsilon)
 
void setGamma (double gamma)
 
void setP (double p)
 
void setTolerance (double tolerance)
 
 ~Newton () 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_ALPHA1 = 1e-6
 default steepest descent restart parameter 1 More...
 
static constexpr double DEFAULT_ALPHA2 = 1e-6
 default steepest descent restart parameter 2 More...
 
static constexpr double DEFAULT_BETA = 0.5
 default beta (parameter for Armijo's rule) More...
 
static constexpr double DEFAULT_EPSILON = 1e-18
 default epsilon (parameter for Armijo's rule) More...
 
static constexpr double DEFAULT_GAMMA = 1e-2
 default gamma (parameter for Armijo's rule) More...
 
static constexpr double DEFAULT_P = 0.1
 default steepest descent restart exponent More...
 
static constexpr double DEFAULT_TOLERANCE = 1e-8
 default tolerance (parameter for Armijo's rule) 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 alpha1
 steepest descent restart parameter 1 More...
 
double alpha2
 steepest descent restart parameter 2 More...
 
double beta
 beta (parameter for Armijo's rule) More...
 
const sle_solver::GaussianElimination defaultSleSolver
 default linear solver More...
 
double eps
 epsilon (parameter for Armijo's rule) More...
 
std::unique_ptr< ScalarFunctionHessianfHessian
 objective function Hessian More...
 
double gamma
 gamma (parameter for Armijo's rule) More...
 
double p
 steepest descent restart exponent More...
 
const sle_solver::SLESolversleSolver
 linear solver More...
 
double tol
 tolerance (parameter for Armijo's rule) 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-based nonlinear conjugate gradient method.

The method is restarted with the steepest descent direction if the inner product of negated gradient and search direction is not big enough (criterion depending on three parameters).

Constructor & Destructor Documentation

sgpp::optimization::optimizer::Newton::Newton ( const ScalarFunction f,
const ScalarFunctionHessian fHessian,
size_t  maxItCount = DEFAULT_N,
double  beta = DEFAULT_BETA,
double  gamma = DEFAULT_GAMMA,
double  tolerance = DEFAULT_TOLERANCE,
double  epsilon = DEFAULT_EPSILON,
double  alpha1 = DEFAULT_ALPHA1,
double  alpha2 = DEFAULT_ALPHA2,
double  p = DEFAULT_P 
)

Constructor.

By default, GaussianElimination is used to solve the linear systems.

Parameters
fobjective function
fHessianobjective function Hessian
maxItCountmaximal number of iterations
betabeta (parameter for Armijo's rule)
gammagamma (parameter for Armijo's rule)
tolerancetolerance (parameter for Armijo's rule)
epsilonepsilon (parameter for Armijo's rule)
alpha1steepest descent restart parameter 1
alpha2steepest descent restart parameter 2
psteepest descent restart exponent

References sgpp::optimization::ScalarFunctionHessian::clone().

Referenced by clone().

sgpp::optimization::optimizer::Newton::Newton ( const ScalarFunction f,
const ScalarFunctionHessian fHessian,
size_t  maxItCount,
double  beta,
double  gamma,
double  tolerance,
double  epsilon,
double  alpha1,
double  alpha2,
double  p,
const sle_solver::SLESolver sleSolver 
)

Constructor.

Do not destruct the solver before this object!

Parameters
fobjective function
fHessianobjective function Hessian
maxItCountmaximal number of iterations
betabeta (parameter for Armijo's rule)
gammagamma (parameter for Armijo's rule)
tolerancetolerance (parameter for Armijo's rule)
epsilonepsilon (parameter for Armijo's rule)
alpha1steepest descent restart parameter 1
alpha2steepest descent restart parameter 2
psteepest descent restart exponent
sleSolverreference to linear solver for solving the linear systems (Hessian as coefficient matrix)

References sgpp::optimization::ScalarFunctionHessian::clone().

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

Copy constructor.

Parameters
otheroptimizer to be copied

References fHessian.

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

Destructor.

Member Function Documentation

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

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

References Newton().

double sgpp::optimization::optimizer::Newton::getAlpha1 ( ) const
Returns
steepest descent restart parameter 1

References alpha1.

double sgpp::optimization::optimizer::Newton::getAlpha2 ( ) const
Returns
steepest descent restart parameter 2

References alpha2.

double sgpp::optimization::optimizer::Newton::getBeta ( ) const
Returns
beta (parameter for Armijo's rule)

References beta.

double sgpp::optimization::optimizer::Newton::getEpsilon ( ) const
Returns
epsilon (parameter for Armijo's rule)

References eps.

double sgpp::optimization::optimizer::Newton::getGamma ( ) const
Returns
gamma (parameter for Armijo's rule)

References gamma.

ScalarFunctionHessian & sgpp::optimization::optimizer::Newton::getObjectiveHessian ( ) const
Returns
objective function Hessian

References fHessian.

double sgpp::optimization::optimizer::Newton::getP ( ) const
Returns
steepest descent restart exponent

References p.

double sgpp::optimization::optimizer::Newton::getTolerance ( ) const
Returns
tolerance (parameter for Armijo's rule)

References tol.

void sgpp::optimization::optimizer::Newton::optimize ( )
overridevirtual
void sgpp::optimization::optimizer::Newton::setAlpha1 ( double  alpha1)
Parameters
alpha1steepest descent restart parameter 1

References alpha1.

void sgpp::optimization::optimizer::Newton::setAlpha2 ( double  alpha2)
Parameters
alpha2steepest descent restart parameter 2

References alpha2.

void sgpp::optimization::optimizer::Newton::setBeta ( double  beta)
Parameters
betabeta (parameter for Armijo's rule)

References beta.

void sgpp::optimization::optimizer::Newton::setEpsilon ( double  epsilon)
Parameters
epsilonepsilon (parameter for Armijo's rule)

References eps.

void sgpp::optimization::optimizer::Newton::setGamma ( double  gamma)
Parameters
gammagamma (parameter for Armijo's rule)

References gamma.

void sgpp::optimization::optimizer::Newton::setP ( double  p)
Parameters
psteepest descent restart exponent

References p.

void sgpp::optimization::optimizer::Newton::setTolerance ( double  tolerance)
Parameters
tolerancetolerance (parameter for Armijo's rule)

References tol.

Member Data Documentation

double sgpp::optimization::optimizer::Newton::alpha1
protected

steepest descent restart parameter 1

Referenced by getAlpha1(), optimize(), and setAlpha1().

double sgpp::optimization::optimizer::Newton::alpha2
protected

steepest descent restart parameter 2

Referenced by getAlpha2(), optimize(), and setAlpha2().

double sgpp::optimization::optimizer::Newton::beta
protected

beta (parameter for Armijo's rule)

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

constexpr double sgpp::optimization::optimizer::Newton::DEFAULT_ALPHA1 = 1e-6
static

default steepest descent restart parameter 1

constexpr double sgpp::optimization::optimizer::Newton::DEFAULT_ALPHA2 = 1e-6
static

default steepest descent restart parameter 2

constexpr double sgpp::optimization::optimizer::Newton::DEFAULT_BETA = 0.5
static

default beta (parameter for Armijo's rule)

constexpr double sgpp::optimization::optimizer::Newton::DEFAULT_EPSILON = 1e-18
static

default epsilon (parameter for Armijo's rule)

constexpr double sgpp::optimization::optimizer::Newton::DEFAULT_GAMMA = 1e-2
static

default gamma (parameter for Armijo's rule)

constexpr double sgpp::optimization::optimizer::Newton::DEFAULT_P = 0.1
static

default steepest descent restart exponent

constexpr double sgpp::optimization::optimizer::Newton::DEFAULT_TOLERANCE = 1e-8
static

default tolerance (parameter for Armijo's rule)

const sle_solver::GaussianElimination sgpp::optimization::optimizer::Newton::defaultSleSolver
protected

default linear solver

double sgpp::optimization::optimizer::Newton::eps
protected

epsilon (parameter for Armijo's rule)

Referenced by getEpsilon(), optimize(), and setEpsilon().

std::unique_ptr<ScalarFunctionHessian> sgpp::optimization::optimizer::Newton::fHessian
protected

objective function Hessian

Referenced by getObjectiveHessian(), Newton(), and optimize().

double sgpp::optimization::optimizer::Newton::gamma
protected

gamma (parameter for Armijo's rule)

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

double sgpp::optimization::optimizer::Newton::p
protected

steepest descent restart exponent

Referenced by getP(), optimize(), and setP().

const sle_solver::SLESolver& sgpp::optimization::optimizer::Newton::sleSolver
protected

linear solver

Referenced by optimize().

double sgpp::optimization::optimizer::Newton::tol
protected

tolerance (parameter for Armijo's rule)

Referenced by getTolerance(), optimize(), and setTolerance().


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