13#include <MachineLearning/BaseGradientOptimizationMethod.h>
17 namespace MachineLearning
75 template<
typename Scalar, LineSearchType LSType = MoreThuente>
102 std::function<
Scalar(
const af::array&, af::array&)> function);
113 void SetHistorySize(
const int hs);
129 virtual bool Optimize(
int* cycle =
nullptr)
override;
140 std::vector<int>
SortIndexes(
const std::vector<std::pair<int, Scalar>>& v);
181 void SubspaceMinimization(af::array& x_cauchy, af::array& x, af::array& c, af::array& g, af::array& SubspaceMin);
Base class for gradient-based optimization methods.
Limited-memory BFGS (L-BFGS or LM-BFGS).
Scalar GetOptimality(const af::array &x, const af::array &g)
Gets an optimality.
LBFGSBSolver(int numberOfVariables)
Creates a new instance of the L-BFGS optimization algorithm.
virtual bool Optimize(int *cycle=nullptr) override
Implements the actual optimization algorithm. This method should try to minimize the objective functi...
void GetGeneralizedCauchyPoint(const af::array &x, const af::array &g, af::array &x_cauchy, af::array &c)
Computation of the generalized Cauchy point.
std::vector< int > SortIndexes(const std::vector< std::pair< int, Scalar > > &v)
Sorts pairs (k,v) according v ascending.
Scalar FindAlpha(af::array &x_cp, af::array &du, std::vector< int > &FreeVariables)
Finds alpha* = max{a : a <= 1 and l_i-xc_i <= a*d_i <= u_i-xc_i}.
LBFGSBSolver(int numberOfVariables, std::function< Scalar(const af::array &, af::array &)> function)
Creates a new instance of the L-BFGS optimization algorithm.
LBFGSBSolver(NonlinearObjectiveFunction< Scalar > *function)
Creates a new instance of the L-BFGS optimization algorithm.
void SubspaceMinimization(af::array &x_cauchy, af::array &x, af::array &c, af::array &g, af::array &SubspaceMin)
Solving unbounded probelm.