SG++-Doxygen-Documentation
|
Gradient-based nonlinear conjugate gradient method. More...
#include <Newton.hpp>
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 |
ScalarFunctionHessian & | getObjectiveHessian () 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::DataMatrix & | getHistoryOfOptimalPoints () const |
const base::DataVector & | getHistoryOfOptimalValues () const |
size_t | getN () const |
ScalarFunction & | getObjectiveFunction () const |
const base::DataVector & | getOptimalPoint () const |
double | getOptimalValue () const |
const base::DataVector & | getStartingPoint () 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< ScalarFunctionHessian > | fHessian |
objective function Hessian More... | |
double | gamma |
gamma (parameter for Armijo's rule) More... | |
double | p |
steepest descent restart exponent More... | |
const sle_solver::SLESolver & | sleSolver |
linear solver More... | |
double | tol |
tolerance (parameter for Armijo's rule) More... | |
Protected Attributes inherited from sgpp::optimization::optimizer::UnconstrainedOptimizer | |
std::unique_ptr< ScalarFunction > | f |
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... | |
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).
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.
f | objective function |
fHessian | objective function Hessian |
maxItCount | maximal number of iterations |
beta | beta (parameter for Armijo's rule) |
gamma | gamma (parameter for Armijo's rule) |
tolerance | tolerance (parameter for Armijo's rule) |
epsilon | epsilon (parameter for Armijo's rule) |
alpha1 | steepest descent restart parameter 1 |
alpha2 | steepest descent restart parameter 2 |
p | steepest 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!
f | objective function |
fHessian | objective function Hessian |
maxItCount | maximal number of iterations |
beta | beta (parameter for Armijo's rule) |
gamma | gamma (parameter for Armijo's rule) |
tolerance | tolerance (parameter for Armijo's rule) |
epsilon | epsilon (parameter for Armijo's rule) |
alpha1 | steepest descent restart parameter 1 |
alpha2 | steepest descent restart parameter 2 |
p | steepest descent restart exponent |
sleSolver | reference 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 | ) |
|
override |
Destructor.
|
overridevirtual |
[out] | clone | pointer to cloned object |
Implements sgpp::optimization::optimizer::UnconstrainedOptimizer.
References Newton().
double sgpp::optimization::optimizer::Newton::getAlpha1 | ( | ) | const |
References alpha1.
double sgpp::optimization::optimizer::Newton::getAlpha2 | ( | ) | const |
References alpha2.
double sgpp::optimization::optimizer::Newton::getBeta | ( | ) | const |
References beta.
double sgpp::optimization::optimizer::Newton::getEpsilon | ( | ) | const |
References eps.
double sgpp::optimization::optimizer::Newton::getGamma | ( | ) | const |
References gamma.
ScalarFunctionHessian & sgpp::optimization::optimizer::Newton::getObjectiveHessian | ( | ) | const |
References fHessian.
double sgpp::optimization::optimizer::Newton::getP | ( | ) | const |
References p.
double sgpp::optimization::optimizer::Newton::getTolerance | ( | ) | const |
References tol.
|
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 alpha1, alpha2, sgpp::base::DataVector::append(), sgpp::base::DataMatrix::appendRow(), beta, sgpp::optimization::Printer::disableStatusPrinting(), sgpp::base::DataVector::dotProduct(), sgpp::optimization::Printer::enableStatusPrinting(), eps, sgpp::optimization::optimizer::UnconstrainedOptimizer::f, fHessian, sgpp::optimization::optimizer::UnconstrainedOptimizer::fHist, sgpp::optimization::optimizer::UnconstrainedOptimizer::fOpt, gamma, sgpp::optimization::Printer::getInstance(), sgpp::optimization::Printer::isStatusPrintingEnabled(), sgpp::base::DataVector::l2Norm(), sgpp::optimization::optimizer::lineSearchArmijo(), sgpp::optimization::optimizer::UnconstrainedOptimizer::N, p, sgpp::combigrid::pow(), sgpp::optimization::Printer::printStatusBegin(), sgpp::optimization::Printer::printStatusEnd(), sgpp::optimization::Printer::printStatusUpdate(), sgpp::base::DataMatrix::resize(), create_scripts::s, sleSolver, sgpp::optimization::sle_solver::SLESolver::solve(), tol, sgpp::base::DataVector::toString(), sgpp::optimization::optimizer::UnconstrainedOptimizer::x0, sgpp::optimization::optimizer::UnconstrainedOptimizer::xHist, and sgpp::optimization::optimizer::UnconstrainedOptimizer::xOpt.
void sgpp::optimization::optimizer::Newton::setAlpha1 | ( | double | alpha1 | ) |
alpha1 | steepest descent restart parameter 1 |
References alpha1.
void sgpp::optimization::optimizer::Newton::setAlpha2 | ( | double | alpha2 | ) |
alpha2 | steepest descent restart parameter 2 |
References alpha2.
void sgpp::optimization::optimizer::Newton::setBeta | ( | double | beta | ) |
beta | beta (parameter for Armijo's rule) |
References beta.
void sgpp::optimization::optimizer::Newton::setEpsilon | ( | double | epsilon | ) |
epsilon | epsilon (parameter for Armijo's rule) |
References eps.
void sgpp::optimization::optimizer::Newton::setGamma | ( | double | gamma | ) |
gamma | gamma (parameter for Armijo's rule) |
References gamma.
void sgpp::optimization::optimizer::Newton::setP | ( | double | p | ) |
p | steepest descent restart exponent |
References p.
void sgpp::optimization::optimizer::Newton::setTolerance | ( | double | tolerance | ) |
tolerance | tolerance (parameter for Armijo's rule) |
References tol.
|
protected |
steepest descent restart parameter 1
Referenced by getAlpha1(), optimize(), and setAlpha1().
|
protected |
steepest descent restart parameter 2
Referenced by getAlpha2(), optimize(), and setAlpha2().
|
protected |
beta (parameter for Armijo's rule)
Referenced by getBeta(), optimize(), and setBeta().
|
static |
default steepest descent restart parameter 1
|
static |
default steepest descent restart parameter 2
|
static |
default beta (parameter for Armijo's rule)
|
static |
default epsilon (parameter for Armijo's rule)
|
static |
default gamma (parameter for Armijo's rule)
|
static |
default steepest descent restart exponent
|
static |
default tolerance (parameter for Armijo's rule)
|
protected |
default linear solver
|
protected |
epsilon (parameter for Armijo's rule)
Referenced by getEpsilon(), optimize(), and setEpsilon().
|
protected |
objective function Hessian
Referenced by getObjectiveHessian(), Newton(), and optimize().
|
protected |
gamma (parameter for Armijo's rule)
Referenced by getGamma(), optimize(), and setGamma().
|
protected |
steepest descent restart exponent
Referenced by getP(), optimize(), and setP().
|
protected |
linear solver
Referenced by optimize().
|
protected |
tolerance (parameter for Armijo's rule)
Referenced by getTolerance(), optimize(), and setTolerance().