SG++-Doxygen-Documentation
|
BFGS method for unconstrained optimization. More...
#include <BFGS.hpp>
Public Member Functions | |
BFGS (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... | |
BFGS (const BFGS &other) | |
Copy constructor. More... | |
void | clone (std::unique_ptr< UnconstrainedOptimizer > &clone) const override |
double | getLineSearchAccuracy () const |
ScalarFunctionGradient & | getObjectiveGradient () 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) |
~BFGS () 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_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< ScalarFunctionGradient > | fGradient |
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< 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... | |
BFGS method for unconstrained optimization.
sgpp::optimization::optimizer::BFGS::BFGS | ( | 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.
f | objective function |
fGradient | objective function gradient |
maxItCount | maximal number of function evaluations |
tolerance | tolerance |
stepSizeIncreaseFactor | step size increase factor |
stepSizeDecreaseFactor | step size decrease factor |
lineSearchAccuracy | line search accuracy |
References sgpp::optimization::ScalarFunctionGradient::clone().
Referenced by clone().
sgpp::optimization::optimizer::BFGS::BFGS | ( | const BFGS & | other | ) |
|
override |
Destructor.
|
overridevirtual |
[out] | clone | pointer to cloned object |
Implements sgpp::optimization::optimizer::UnconstrainedOptimizer.
References BFGS().
double sgpp::optimization::optimizer::BFGS::getLineSearchAccuracy | ( | ) | const |
References rhoLs.
ScalarFunctionGradient & sgpp::optimization::optimizer::BFGS::getObjectiveGradient | ( | ) | const |
References fGradient.
double sgpp::optimization::optimizer::BFGS::getStepSizeDecreaseFactor | ( | ) | const |
References rhoAlphaMinus.
double sgpp::optimization::optimizer::BFGS::getStepSizeIncreaseFactor | ( | ) | const |
References rhoAlphaPlus.
double sgpp::optimization::optimizer::BFGS::getTolerance | ( | ) | const |
References theta.
|
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 alpha, sgpp::base::DataVector::append(), sgpp::base::DataMatrix::appendRow(), sgpp::base::DataVector::dotProduct(), sgpp::optimization::optimizer::UnconstrainedOptimizer::f, fGradient, sgpp::optimization::optimizer::UnconstrainedOptimizer::fHist, sgpp::optimization::optimizer::UnconstrainedOptimizer::fOpt, sgpp::optimization::Printer::getInstance(), python.statsfileInfo::i, python.utils.statsfile2gnuplot::j, sgpp::base::DataVector::l2Norm(), sgpp::optimization::optimizer::UnconstrainedOptimizer::N, friedman::p, sgpp::optimization::Printer::printStatusBegin(), sgpp::optimization::Printer::printStatusEnd(), sgpp::optimization::Printer::printStatusUpdate(), sgpp::base::DataMatrix::resize(), rhoAlphaMinus, rhoAlphaPlus, rhoLs, theta, sgpp::base::DataVector::toString(), sgpp::optimization::optimizer::UnconstrainedOptimizer::x0, sgpp::optimization::optimizer::UnconstrainedOptimizer::xHist, and sgpp::optimization::optimizer::UnconstrainedOptimizer::xOpt.
void sgpp::optimization::optimizer::BFGS::setLineSearchAccuracy | ( | double | lineSearchAccuracy | ) |
lineSearchAccuracy | line search accuracy |
References rhoLs.
void sgpp::optimization::optimizer::BFGS::setStepSizeDecreaseFactor | ( | double | stepSizeDecreaseFactor | ) |
stepSizeDecreaseFactor | step size decrease factor |
References rhoAlphaMinus.
void sgpp::optimization::optimizer::BFGS::setStepSizeIncreaseFactor | ( | double | stepSizeIncreaseFactor | ) |
stepSizeIncreaseFactor | step size increase factor |
References rhoAlphaPlus.
void sgpp::optimization::optimizer::BFGS::setTolerance | ( | double | tolerance | ) |
tolerance | tolerance |
References theta.
|
static |
default line search accuracy
|
static |
default step size decrease factor
|
static |
default step size increase factor
|
static |
default tolerance
|
protected |
objective function gradient
Referenced by BFGS(), getObjectiveGradient(), and optimize().
|
protected |
step size decrease factor
Referenced by getStepSizeDecreaseFactor(), optimize(), and setStepSizeDecreaseFactor().
|
protected |
step size increase factor
Referenced by getStepSizeIncreaseFactor(), optimize(), and setStepSizeIncreaseFactor().
|
protected |
line search accuracy
Referenced by getLineSearchAccuracy(), optimize(), and setLineSearchAccuracy().
|
protected |
tolerance
Referenced by getTolerance(), optimize(), and setTolerance().