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

Gradient-based method of steepest descent. More...

#include <GradientDescent.hpp>

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

Public Member Functions

void clone (std::unique_ptr< UnconstrainedOptimizer > &clone) const override
 
double getBeta () const
 
double getEpsilon () const
 
double getGamma () const
 
ScalarFunctionGradientgetObjectiveGradient () const
 
double getTolerance () const
 
 GradientDescent (const ScalarFunction &f, const ScalarFunctionGradient &fGradient, size_t maxItCount=DEFAULT_MAX_IT_COUNT, double beta=DEFAULT_BETA, double gamma=DEFAULT_GAMMA, double tolerance=DEFAULT_TOLERANCE, double epsilon=DEFAULT_EPSILON)
 Constructor. More...
 
 GradientDescent (const GradientDescent &other)
 Copy constructor. More...
 
void optimize () override
 Pure virtual method for optimization of the objective function. More...
 
void setBeta (double beta)
 
void setEpsilon (double epsilon)
 
void setGamma (double gamma)
 
void setTolerance (double tolerance)
 
 ~GradientDescent () 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_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 const size_t DEFAULT_MAX_IT_COUNT = 2000
 default maximal number of iterations 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 beta
 beta (parameter for Armijo's rule) More...
 
double eps
 epsilon (parameter for Armijo's rule) More...
 
std::unique_ptr< ScalarFunctionGradientfGradient
 objective function gradient More...
 
double gamma
 gamma (parameter for Armijo's rule) 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 method of steepest descent.

Constructor & Destructor Documentation

◆ GradientDescent() [1/2]

sgpp::optimization::optimizer::GradientDescent::GradientDescent ( const ScalarFunction f,
const ScalarFunctionGradient fGradient,
size_t  maxItCount = DEFAULT_MAX_IT_COUNT,
double  beta = DEFAULT_BETA,
double  gamma = DEFAULT_GAMMA,
double  tolerance = DEFAULT_TOLERANCE,
double  epsilon = DEFAULT_EPSILON 
)

Constructor.

Parameters
fobjective function
fGradientobjective function gradient
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)

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

Referenced by clone().

◆ GradientDescent() [2/2]

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

Copy constructor.

Parameters
otheroptimizer to be copied

References fGradient.

◆ ~GradientDescent()

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

Destructor.

Member Function Documentation

◆ clone()

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

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

References GradientDescent().

◆ getBeta()

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

References beta.

◆ getEpsilon()

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

References eps.

◆ getGamma()

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

References gamma.

◆ getObjectiveGradient()

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

References fGradient.

◆ getTolerance()

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

References tol.

◆ optimize()

◆ setBeta()

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

References beta.

◆ setEpsilon()

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

References eps.

◆ setGamma()

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

References gamma.

◆ setTolerance()

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

References tol.

Member Data Documentation

◆ beta

double sgpp::optimization::optimizer::GradientDescent::beta
protected

beta (parameter for Armijo's rule)

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

◆ DEFAULT_BETA

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

default beta (parameter for Armijo's rule)

◆ DEFAULT_EPSILON

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

default epsilon (parameter for Armijo's rule)

◆ DEFAULT_GAMMA

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

default gamma (parameter for Armijo's rule)

◆ DEFAULT_MAX_IT_COUNT

const size_t sgpp::optimization::optimizer::GradientDescent::DEFAULT_MAX_IT_COUNT = 2000
static

default maximal number of iterations

◆ DEFAULT_TOLERANCE

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

default tolerance (parameter for Armijo's rule)

◆ eps

double sgpp::optimization::optimizer::GradientDescent::eps
protected

epsilon (parameter for Armijo's rule)

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

◆ fGradient

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

objective function gradient

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

◆ gamma

double sgpp::optimization::optimizer::GradientDescent::gamma
protected

gamma (parameter for Armijo's rule)

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

◆ tol

double sgpp::optimization::optimizer::GradientDescent::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: