6 #ifndef TURI_LBFGS_2_H_ 7 #define TURI_LBFGS_2_H_ 9 #include <ml/optimization/optimization_interface.hpp> 10 #include <core/data/flexible_type/flexible_type.hpp> 11 #include <core/storage/sframe_data/sframe.hpp> 13 #include <ml/optimization/utils.hpp> 14 #include <ml/optimization/optimization_interface.hpp> 15 #include <ml/optimization/regularizer_interface.hpp> 16 #include <ml/optimization/line_search-inl.hpp> 19 typedef Eigen::VectorXd DenseVector;
20 typedef Eigen::MatrixXd DenseMatrix;
24 namespace optimization {
112 void setup(
const DenseVector& init_point,
113 const std::map<std::string, flexible_type>& opts,
114 const std::shared_ptr<smooth_regularizer_interface>& reg =
nullptr);
121 bool next_iteration();
136 std::shared_ptr<first_order_opt_interface> model;
138 std::shared_ptr<smooth_regularizer_interface> reg;
140 size_t num_variables = 0;
141 size_t lbfgs_memory_level = 0;
151 Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor> y;
154 Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor> s;
162 DenseVector delta_point,
gradient, delta_grad, previous_gradient;
164 double convergence_threshold = 0;
170 std::shared_ptr<first_order_opt_interface> model,
171 const DenseVector& init_point,
172 const std::map<std::string, flexible_type>& opts,
173 const std::shared_ptr<smooth_regularizer_interface>& reg =
nullptr);
193 std::shared_ptr<first_order_opt_interface> model,
194 const DenseVector& init_point,
195 const std::map<std::string, flexible_type>& opts,
196 const std::shared_ptr<smooth_regularizer_interface>& reg =
nullptr);
size_t num_function_evaluations
OPTIMIZATION_STATUS
Optimization status.
OPTIMIZATION_STATUS status
Optimizer wasn't called.
solver_status lbfgs(std::shared_ptr< first_order_opt_interface > model, const DenseVector &init_point, const std::map< std::string, flexible_type > &opts, const std::shared_ptr< smooth_regularizer_interface > ®=nullptr)
lbfgs_solver(std::shared_ptr< first_order_opt_interface > _model)
const solver_status & status() const
size_t num_gradient_evaluations
A simple class that can be used for benchmarking/timing up to microsecond resolution.