MADNESS 0.10.1
|
Optimization via quasi-Newton (BFGS or SR1 update) More...
#include <solvers.h>
Public Member Functions | |
QuasiNewton (const std::shared_ptr< OptimizationTargetInterface > &tar, int maxiter=20, double tol=1e-6, double value_precision=1e-12, double gradient_precision=1e-12) | |
virtual | ~QuasiNewton () |
bool | converged () const |
After running the optimizer returns true if converged. | |
double | gradient_norm () const |
Value of gradient norm. | |
Tensor< double > | new_search_direction (const Tensor< double > &g) const |
bool | optimize (Tensor< double > &x) |
Runs the optimizer. | |
void | reset_hessian () |
Resets Hessian to default guess. | |
void | set_hessian (const Tensor< double > &matrix) |
Sets Hessian to given matrix. | |
void | set_test (const bool &test_level) |
Choose update method (currently only "BFGS" or "SR1") | |
void | set_update (const std::string &method) |
Choose update method (currently only "BFGS" or "SR1") | |
double | value () const |
Value of objective function. | |
Public Member Functions inherited from madness::OptimizerInterface | |
virtual | ~OptimizerInterface () |
Static Public Member Functions | |
static void | hessian_update_bfgs (const Tensor< double > &dx, const Tensor< double > &dg, Tensor< double > &hessian) |
make this static for other QN classed to have access to it | |
static void | hessian_update_sr1 (const Tensor< double > &s, const Tensor< double > &y, Tensor< double > &hessian) |
make this static for other QN classed to have access to it | |
static double | line_search (double a1, double f0, double dxgrad, const Tensor< double > &x, const Tensor< double > &dx, std::shared_ptr< OptimizationTargetInterface > target, double value_precision) |
make this static for other QN classed to have access to it | |
Protected Attributes | |
double | f |
double | gnorm |
const double | gradient_precision |
Tensor< double > | h |
const int | maxiter |
int | n |
bool | printtest |
std::shared_ptr< OptimizationTargetInterface > | target |
const double | tol |
std::string | update |
const double | value_precision |
Optimization via quasi-Newton (BFGS or SR1 update)
This is presently not a low memory algorithm ... we really need one!
QuasiNewton::QuasiNewton | ( | const std::shared_ptr< OptimizationTargetInterface > & | tar, |
int | maxiter = 20 , |
||
double | tol = 1e-6 , |
||
double | value_precision = 1e-12 , |
||
double | gradient_precision = 1e-12 |
||
) |
References target.
|
inlinevirtual |
|
virtual |
After running the optimizer returns true if converged.
Implements madness::OptimizerInterface.
Referenced by optimize().
|
virtual |
Value of gradient norm.
Implements madness::OptimizerInterface.
References gnorm.
|
static |
make this static for other QN classed to have access to it
References std::abs(), madness::BaseTensor::dim(), madness::inner(), n, and madness::Tensor< T >::trace().
Referenced by optimize(), and madness::MolecularOptimizer::optimize_quasi_newton().
|
static |
make this static for other QN classed to have access to it
References std::abs(), e(), madness::inner(), madness::outer(), q(), and madness::Tensor< T >::scale().
Referenced by optimize(), and madness::MolecularOptimizer::optimize_quasi_newton().
|
static |
make this static for other QN classed to have access to it
References a1, a2, std::abs(), f1, madness::print(), and value_precision.
Referenced by optimize(), and madness::MolecularOptimizer::optimize_quasi_newton().
References std::abs(), e(), madness::g, gradient_precision, h, madness::inner(), n, printtest, madness::syev(), tol, and v.
Referenced by optimize().
|
virtual |
Runs the optimizer.
Implements madness::OptimizerInterface.
References converged(), madness::BaseTensor::dim(), f, madness::g, gnorm, h, hessian_update_bfgs(), hessian_update_sr1(), line_search(), maxiter, n, new_search_direction(), madness::Tensor< T >::normf(), madness::print(), printtest, madness::Tensor< T >::scale(), madness::BaseTensor::size(), target, madness::Tensor< T >::trace(), update, and value_precision.
|
inline |
Resets Hessian to default guess.
References h.
|
inline |
Sets Hessian to given matrix.
References madness::copy(), and h.
void QuasiNewton::set_test | ( | const bool & | test_level | ) |
Choose update method (currently only "BFGS" or "SR1")
References printtest.
void QuasiNewton::set_update | ( | const std::string & | method | ) |
Choose update method (currently only "BFGS" or "SR1")
References update.
|
virtual |
Value of objective function.
Implements madness::OptimizerInterface.
References f.
|
protected |
Referenced by optimize(), and value().
|
protected |
Referenced by converged(), gradient_norm(), and optimize().
|
protected |
Referenced by new_search_direction().
|
protected |
Referenced by new_search_direction(), optimize(), reset_hessian(), and set_hessian().
|
protected |
Referenced by optimize().
|
protected |
Referenced by hessian_update_bfgs(), new_search_direction(), and optimize().
|
protected |
Referenced by new_search_direction(), optimize(), and set_test().
|
protected |
Referenced by QuasiNewton(), and optimize().
|
protected |
Referenced by converged(), and new_search_direction().
|
protected |
Referenced by optimize(), and set_update().
|
protected |
Referenced by line_search(), and optimize().