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

Newton method with adaptive step size. More...

#include <AdaptiveNewton.hpp>

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

Public Member Functions

 AdaptiveNewton (const ScalarFunction &f, const ScalarFunctionHessian &fHessian, size_t maxItCount=DEFAULT_N, double tolerance=DEFAULT_TOLERANCE, double stepSizeIncreaseFactor=DEFAULT_STEP_SIZE_INCREASE_FACTOR, double stepSizeDecreaseFactor=DEFAULT_STEP_SIZE_DECREASE_FACTOR, double dampingIncreaseFactor=DEFAULT_DAMPING_INCREASE_FACTOR, double dampingDecreaseFactor=DEFAULT_DAMPING_DECREASE_FACTOR, double lineSearchAccuracy=DEFAULT_LINE_SEARCH_ACCURACY)
 Constructor. More...
 
 AdaptiveNewton (const ScalarFunction &f, const ScalarFunctionHessian &fHessian, size_t maxItCount, double tolerance, double stepSizeIncreaseFactor, double stepSizeDecreaseFactor, double dampingIncreaseFactor, double dampingDecreaseFactor, double lineSearchAccuracy, const sle_solver::SLESolver &sleSolver)
 Constructor. More...
 
 AdaptiveNewton (const AdaptiveNewton &other)
 Copy constructor. More...
 
void clone (std::unique_ptr< UnconstrainedOptimizer > &clone) const override
 
double getDampingDecreaseFactor () const
 
double getDampingIncreaseFactor () const
 
double getLineSearchAccuracy () const
 
ScalarFunctionHessiangetObjectiveHessian () const
 
double getStepSizeDecreaseFactor () const
 
double getStepSizeIncreaseFactor () const
 
double getTolerance () const
 
void optimize () override
 Pure virtual method for optimization of the objective function. More...
 
void setDampingDecreaseFactor (double dampingDecreaseFactor)
 
void setDampingIncreaseFactor (double dampingIncreaseFactor)
 
void setLineSearchAccuracy (double lineSearchAccuracy)
 
void setStepSizeDecreaseFactor (double stepSizeDecreaseFactor)
 
void setStepSizeIncreaseFactor (double stepSizeIncreaseFactor)
 
void setTolerance (double tolerance)
 
 ~AdaptiveNewton () 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_DAMPING_DECREASE_FACTOR = 0.5
 default damping decrease factor More...
 
static constexpr double DEFAULT_DAMPING_INCREASE_FACTOR = 1.0
 default damping increase factor More...
 
static constexpr double DEFAULT_LINE_SEARCH_ACCURACY = 0.01
 default line search accuracy More...
 
static constexpr double DEFAULT_STEP_SIZE_DECREASE_FACTOR = 0.5
 default step size decrease factor More...
 
static constexpr double DEFAULT_STEP_SIZE_INCREASE_FACTOR = 1.2
 default step size increase factor More...
 
static constexpr double DEFAULT_TOLERANCE = 1e-6
 default tolerance 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

const sle_solver::GaussianElimination defaultSleSolver
 default linear solver More...
 
std::unique_ptr< ScalarFunctionHessianfHessian
 objective function Hessian More...
 
double rhoAlphaMinus
 step size decrease factor More...
 
double rhoAlphaPlus
 step size increase factor More...
 
double rhoLambdaMinus
 damping decrease factor More...
 
double rhoLambdaPlus
 damping increase factor More...
 
double rhoLs
 line search accuracy More...
 
const sle_solver::SLESolversleSolver
 linear solver More...
 
double theta
 tolerance 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

Newton method with adaptive step size.

Constructor & Destructor Documentation

◆ AdaptiveNewton() [1/3]

sgpp::optimization::optimizer::AdaptiveNewton::AdaptiveNewton ( const ScalarFunction f,
const ScalarFunctionHessian fHessian,
size_t  maxItCount = DEFAULT_N,
double  tolerance = DEFAULT_TOLERANCE,
double  stepSizeIncreaseFactor = DEFAULT_STEP_SIZE_INCREASE_FACTOR,
double  stepSizeDecreaseFactor = DEFAULT_STEP_SIZE_DECREASE_FACTOR,
double  dampingIncreaseFactor = DEFAULT_DAMPING_INCREASE_FACTOR,
double  dampingDecreaseFactor = DEFAULT_DAMPING_DECREASE_FACTOR,
double  lineSearchAccuracy = DEFAULT_LINE_SEARCH_ACCURACY 
)

Constructor.

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

Parameters
fobjective function
fHessianobjective function Hessian
maxItCountmaximal number of function evaluations
tolerancetolerance
stepSizeIncreaseFactorstep size increase factor
stepSizeDecreaseFactorstep size decrease factor
dampingIncreaseFactordamping increase factor
dampingDecreaseFactordamping decrease factor
lineSearchAccuracyline search accuracy

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

Referenced by clone().

◆ AdaptiveNewton() [2/3]

sgpp::optimization::optimizer::AdaptiveNewton::AdaptiveNewton ( const ScalarFunction f,
const ScalarFunctionHessian fHessian,
size_t  maxItCount,
double  tolerance,
double  stepSizeIncreaseFactor,
double  stepSizeDecreaseFactor,
double  dampingIncreaseFactor,
double  dampingDecreaseFactor,
double  lineSearchAccuracy,
const sle_solver::SLESolver sleSolver 
)

Constructor.

Do not destruct the solver before this object!

Parameters
fobjective function
fHessianobjective function Hessian
maxItCountmaximal number of function evaluations
tolerancetolerance
stepSizeIncreaseFactorstep size increase factor
stepSizeDecreaseFactorstep size decrease factor
dampingIncreaseFactordamping increase factor
dampingDecreaseFactordamping decrease factor
lineSearchAccuracyline search accuracy
sleSolverreference to linear solver for solving the linear systems (Hessian as coefficient matrix)

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

◆ AdaptiveNewton() [3/3]

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

Copy constructor.

Parameters
otheroptimizer to be copied

References fHessian.

◆ ~AdaptiveNewton()

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

Destructor.

Member Function Documentation

◆ clone()

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

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

References AdaptiveNewton().

◆ getDampingDecreaseFactor()

double sgpp::optimization::optimizer::AdaptiveNewton::getDampingDecreaseFactor ( ) const
Returns
damping decrease factor

References rhoLambdaMinus.

◆ getDampingIncreaseFactor()

double sgpp::optimization::optimizer::AdaptiveNewton::getDampingIncreaseFactor ( ) const
Returns
damping increase factor

References rhoLambdaPlus.

◆ getLineSearchAccuracy()

double sgpp::optimization::optimizer::AdaptiveNewton::getLineSearchAccuracy ( ) const
Returns
line search accuracy

References rhoLs.

◆ getObjectiveHessian()

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

References fHessian.

◆ getStepSizeDecreaseFactor()

double sgpp::optimization::optimizer::AdaptiveNewton::getStepSizeDecreaseFactor ( ) const
Returns
step size decrease factor

References rhoAlphaMinus.

◆ getStepSizeIncreaseFactor()

double sgpp::optimization::optimizer::AdaptiveNewton::getStepSizeIncreaseFactor ( ) const
Returns
step size increase factor

References rhoAlphaPlus.

◆ getTolerance()

double sgpp::optimization::optimizer::AdaptiveNewton::getTolerance ( ) const
Returns
tolerance

References theta.

◆ optimize()

void sgpp::optimization::optimizer::AdaptiveNewton::optimize ( )
overridevirtual

◆ setDampingDecreaseFactor()

void sgpp::optimization::optimizer::AdaptiveNewton::setDampingDecreaseFactor ( double  dampingDecreaseFactor)
Parameters
dampingDecreaseFactordamping decrease factor

References rhoLambdaMinus.

◆ setDampingIncreaseFactor()

void sgpp::optimization::optimizer::AdaptiveNewton::setDampingIncreaseFactor ( double  dampingIncreaseFactor)
Parameters
dampingIncreaseFactordamping increase factor

References rhoLambdaPlus.

◆ setLineSearchAccuracy()

void sgpp::optimization::optimizer::AdaptiveNewton::setLineSearchAccuracy ( double  lineSearchAccuracy)
Parameters
lineSearchAccuracyline search accuracy

References rhoLs.

◆ setStepSizeDecreaseFactor()

void sgpp::optimization::optimizer::AdaptiveNewton::setStepSizeDecreaseFactor ( double  stepSizeDecreaseFactor)
Parameters
stepSizeDecreaseFactorstep size decrease factor

References rhoAlphaMinus.

◆ setStepSizeIncreaseFactor()

void sgpp::optimization::optimizer::AdaptiveNewton::setStepSizeIncreaseFactor ( double  stepSizeIncreaseFactor)
Parameters
stepSizeIncreaseFactorstep size increase factor

References rhoAlphaPlus.

◆ setTolerance()

void sgpp::optimization::optimizer::AdaptiveNewton::setTolerance ( double  tolerance)
Parameters
tolerancetolerance

References theta.

Member Data Documentation

◆ DEFAULT_DAMPING_DECREASE_FACTOR

constexpr double sgpp::optimization::optimizer::AdaptiveNewton::DEFAULT_DAMPING_DECREASE_FACTOR = 0.5
static

default damping decrease factor

◆ DEFAULT_DAMPING_INCREASE_FACTOR

constexpr double sgpp::optimization::optimizer::AdaptiveNewton::DEFAULT_DAMPING_INCREASE_FACTOR = 1.0
static

default damping increase factor

◆ DEFAULT_LINE_SEARCH_ACCURACY

constexpr double sgpp::optimization::optimizer::AdaptiveNewton::DEFAULT_LINE_SEARCH_ACCURACY = 0.01
static

default line search accuracy

◆ DEFAULT_STEP_SIZE_DECREASE_FACTOR

constexpr double sgpp::optimization::optimizer::AdaptiveNewton::DEFAULT_STEP_SIZE_DECREASE_FACTOR = 0.5
static

default step size decrease factor

◆ DEFAULT_STEP_SIZE_INCREASE_FACTOR

constexpr double sgpp::optimization::optimizer::AdaptiveNewton::DEFAULT_STEP_SIZE_INCREASE_FACTOR = 1.2
static

default step size increase factor

◆ DEFAULT_TOLERANCE

constexpr double sgpp::optimization::optimizer::AdaptiveNewton::DEFAULT_TOLERANCE = 1e-6
static

default tolerance

◆ defaultSleSolver

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

default linear solver

◆ fHessian

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

objective function Hessian

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

◆ rhoAlphaMinus

double sgpp::optimization::optimizer::AdaptiveNewton::rhoAlphaMinus
protected

step size decrease factor

Referenced by getStepSizeDecreaseFactor(), optimize(), and setStepSizeDecreaseFactor().

◆ rhoAlphaPlus

double sgpp::optimization::optimizer::AdaptiveNewton::rhoAlphaPlus
protected

step size increase factor

Referenced by getStepSizeIncreaseFactor(), optimize(), and setStepSizeIncreaseFactor().

◆ rhoLambdaMinus

double sgpp::optimization::optimizer::AdaptiveNewton::rhoLambdaMinus
protected

damping decrease factor

Referenced by getDampingDecreaseFactor(), optimize(), and setDampingDecreaseFactor().

◆ rhoLambdaPlus

double sgpp::optimization::optimizer::AdaptiveNewton::rhoLambdaPlus
protected

damping increase factor

Referenced by getDampingIncreaseFactor(), optimize(), and setDampingIncreaseFactor().

◆ rhoLs

double sgpp::optimization::optimizer::AdaptiveNewton::rhoLs
protected

line search accuracy

Referenced by getLineSearchAccuracy(), optimize(), and setLineSearchAccuracy().

◆ sleSolver

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

linear solver

Referenced by optimize().

◆ theta

double sgpp::optimization::optimizer::AdaptiveNewton::theta
protected

tolerance

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


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