Turi Create
4.0
|
#include <ml/optimization/optimization_interface.hpp>
Public Member Functions | |
virtual | ~second_order_opt_interface () |
virtual void | compute_second_order_statistics (const DenseVector &point, DenseMatrix &Hessian, DenseVector &gradient, double &function_value)=0 |
virtual void | compute_hessian (const DenseVector &point, DenseMatrix &hessian) |
virtual size_t | num_examples () const =0 |
virtual size_t | num_variables () const =0 |
virtual void | compute_first_order_statistics (const DenseVector &point, DenseVector &gradient, double &function_value, const size_t mbStart=0, const size_t mbSize=-1)=0 |
virtual double | compute_function_value (const DenseVector &point, const size_t mbStart=0, const size_t mbSize=-1) |
virtual void | compute_gradient (const DenseVector &point, DenseVector &gradient, const size_t mbStart=0, const size_t mbSize=-1) |
virtual void | reset (int seed) |
virtual std::vector< std::pair< std::string, size_t > > | get_status_header (const std::vector< std::string > &stats) |
virtual std::vector< std::string > | get_status (const DenseVector &coefs, const std::vector< std::string > &stats) |
The interface to inherit from to describe a second order optimization model.
This model must implement methods to compute hessian as well as gradient.
Definition at line 253 of file optimization_interface.hpp.
|
virtual |
Default desctuctor.
|
pure virtualinherited |
Compute first order statistics at the given point. (Gradient & Function value)
[in] | point | Point at which we are computing the stats. |
[out] | gradient | Dense gradient |
[out] | function_value | Function value |
[in] | mbStart | Minibatch start index |
[in] | mbSize | Minibatch size (-1 implies all) |
Implemented in turi::supervised::linear_svm_scaled_logistic_opt_interface, turi::supervised::logistic_regression_opt_interface, and turi::supervised::linear_regression_opt_interface.
|
virtualinherited |
Compute the function value at a given point.
[in] | point | Point at which we are computing the gradient. |
[in] | mbStart | Minibatch start index |
[in] | mbSize | Minibatch size (-1 implies all) |
|
virtualinherited |
Compute a gradient at the given point.
[in] | point | Point at which we are computing the gradient. |
[out] | gradient | Dense gradient |
[in] | mbStart | Minibatch start index |
[in] | mbSize | Minibatch size (-1 implies all) |
|
virtual |
Compute the hessian at the given point
[in] | point | Point at which we are computing the function value. |
[out] | hessian | Returns a dense hessian matrix. |
|
pure virtual |
Compute second order statistics at the given point. (Hessian, Gradient & Function value)
[in] | point | Point at which we are computing the stats. |
[out] | hessian | Hessian computation (dense) |
[out] | gradient | Dense gradient |
[out] | function_value | Function value |
Implemented in turi::supervised::logistic_regression_opt_interface, and turi::supervised::linear_regression_opt_interface.
|
virtualinherited |
Get strings needed to print a row of the progress table.
[in] | a | vector of model coefficients. |
[in] | a | vector of stats to print at the beginning of each row |
Reimplemented in turi::supervised::logistic_regression_opt_interface, turi::supervised::linear_svm_scaled_logistic_opt_interface, and turi::supervised::linear_regression_opt_interface.
|
virtualinherited |
Get strings needed to print the header for the progress table.
[in] | a | vector of strings to print at the beginning of the header. |
Reimplemented in turi::supervised::logistic_regression_opt_interface, turi::supervised::linear_svm_scaled_logistic_opt_interface, and turi::supervised::linear_regression_opt_interface.
|
pure virtualinherited |
Get the number of examples in the dataset (Required for SGD).
Implemented in turi::supervised::linear_svm_scaled_logistic_opt_interface, turi::supervised::logistic_regression_opt_interface, and turi::supervised::linear_regression_opt_interface.
|
pure virtualinherited |
Get the number of variables in the optimization problem.
Implemented in turi::supervised::linear_svm_scaled_logistic_opt_interface, turi::supervised::logistic_regression_opt_interface, and turi::supervised::linear_regression_opt_interface.
|
virtualinherited |
Reset the state of the model's "randomness" source.
[in] | seed | Seed that is the source of randomness. |