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

Gradient descent with adaptive step size. More...

#include <AdaptiveGradientDescent.hpp>

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

Public Member Functions

 AdaptiveGradientDescent (const ScalarFunction &f, const ScalarFunctionGradient &fGradient, size_t maxItCount=DEFAULT_N, double tolerance=DEFAULT_TOLERANCE, double stepSizeIncreaseFactor=DEFAULT_STEP_SIZE_INCREASE_FACTOR, double stepSizeDecreaseFactor=DEFAULT_STEP_SIZE_DECREASE_FACTOR, double lineSearchAccuracy=DEFAULT_LINE_SEARCH_ACCURACY)
 Constructor. More...
 
 AdaptiveGradientDescent (const AdaptiveGradientDescent &other)
 Copy constructor. More...
 
void clone (std::unique_ptr< UnconstrainedOptimizer > &clone) const override
 
double getLineSearchAccuracy () const
 
ScalarFunctionGradientgetObjectiveGradient () const
 
double getStepSizeDecreaseFactor () const
 
double getStepSizeIncreaseFactor () const
 
double getTolerance () const
 
void optimize () override
 Pure virtual method for optimization of the objective function. More...
 
void setLineSearchAccuracy (double lineSearchAccuracy)
 
void setStepSizeDecreaseFactor (double stepSizeDecreaseFactor)
 
void setStepSizeIncreaseFactor (double stepSizeIncreaseFactor)
 
void setTolerance (double tolerance)
 
 ~AdaptiveGradientDescent () 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_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

std::unique_ptr< ScalarFunctionGradientfGradient
 objective function gradient More...
 
double rhoAlphaMinus
 step size decrease factor More...
 
double rhoAlphaPlus
 step size increase factor More...
 
double rhoLs
 line search accuracy 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

Gradient descent with adaptive step size.

Constructor & Destructor Documentation

◆ AdaptiveGradientDescent() [1/2]

sgpp::optimization::optimizer::AdaptiveGradientDescent::AdaptiveGradientDescent ( const ScalarFunction f,
const ScalarFunctionGradient fGradient,
size_t  maxItCount = DEFAULT_N,
double  tolerance = DEFAULT_TOLERANCE,
double  stepSizeIncreaseFactor = DEFAULT_STEP_SIZE_INCREASE_FACTOR,
double  stepSizeDecreaseFactor = DEFAULT_STEP_SIZE_DECREASE_FACTOR,
double  lineSearchAccuracy = DEFAULT_LINE_SEARCH_ACCURACY 
)

Constructor.

Parameters
fobjective function
fGradientobjective function gradient
maxItCountmaximal number of function evaluations
tolerancetolerance
stepSizeIncreaseFactorstep size increase factor
stepSizeDecreaseFactorstep size decrease factor
lineSearchAccuracyline search accuracy

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

Referenced by clone().

◆ AdaptiveGradientDescent() [2/2]

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

Copy constructor.

Parameters
otheroptimizer to be copied

References fGradient.

◆ ~AdaptiveGradientDescent()

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

Destructor.

Member Function Documentation

◆ clone()

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

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

References AdaptiveGradientDescent().

◆ getLineSearchAccuracy()

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

References rhoLs.

◆ getObjectiveGradient()

ScalarFunctionGradient & sgpp::optimization::optimizer::AdaptiveGradientDescent::getObjectiveGradient ( ) const
Returns
objective function gradient

References fGradient.

◆ getStepSizeDecreaseFactor()

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

References rhoAlphaMinus.

◆ getStepSizeIncreaseFactor()

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

References rhoAlphaPlus.

◆ getTolerance()

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

References theta.

◆ optimize()

◆ setLineSearchAccuracy()

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

References rhoLs.

◆ setStepSizeDecreaseFactor()

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

References rhoAlphaMinus.

◆ setStepSizeIncreaseFactor()

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

References rhoAlphaPlus.

◆ setTolerance()

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

References theta.

Member Data Documentation

◆ DEFAULT_LINE_SEARCH_ACCURACY

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

default line search accuracy

◆ DEFAULT_STEP_SIZE_DECREASE_FACTOR

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

default step size decrease factor

◆ DEFAULT_STEP_SIZE_INCREASE_FACTOR

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

default step size increase factor

◆ DEFAULT_TOLERANCE

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

default tolerance

◆ fGradient

std::unique_ptr<ScalarFunctionGradient> sgpp::optimization::optimizer::AdaptiveGradientDescent::fGradient
protected

objective function gradient

Referenced by AdaptiveGradientDescent(), getObjectiveGradient(), and optimize().

◆ rhoAlphaMinus

double sgpp::optimization::optimizer::AdaptiveGradientDescent::rhoAlphaMinus
protected

step size decrease factor

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

◆ rhoAlphaPlus

double sgpp::optimization::optimizer::AdaptiveGradientDescent::rhoAlphaPlus
protected

step size increase factor

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

◆ rhoLs

double sgpp::optimization::optimizer::AdaptiveGradientDescent::rhoLs
protected

line search accuracy

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

◆ theta

double sgpp::optimization::optimizer::AdaptiveGradientDescent::theta
protected

tolerance

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


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