Quadratic program solver for box-constrained problems with linear kernel. More...
#include <shark/Algorithms/QP/QpBoxLinear.h>
Public Types | |
typedef LabeledData< InputT, unsigned int > | DatasetType |
typedef LabeledData< InputT, unsigned int >::const_element_reference | ElementType |
Public Member Functions | |
QpBoxLinear (const DatasetType &dataset, std::size_t dim) | |
Constructor. More... | |
RealVector | solve (double bound, double reg, QpStoppingCondition &stop, QpSolutionProperties *prop=NULL, bool verbose=false) |
Solve the SVM training problem. More... | |
Protected Attributes | |
DataView< const DatasetType > | m_data |
view on training data More... | |
RealVector | m_xSquared |
diagonal entries of the quadratic matrix More... | |
std::size_t | m_dim |
input space dimension More... | |
Quadratic program solver for box-constrained problems with linear kernel.
Definition at line 73 of file QpBoxLinear.h.
typedef LabeledData<InputT, unsigned int> shark::QpBoxLinear< InputT >::DatasetType |
Definition at line 76 of file QpBoxLinear.h.
typedef LabeledData<InputT, unsigned int>::const_element_reference shark::QpBoxLinear< InputT >::ElementType |
Definition at line 77 of file QpBoxLinear.h.
|
inline |
Constructor.
dataset | training data |
dim | problem dimension |
Definition at line 85 of file QpBoxLinear.h.
References shark::blas::inner_prod(), shark::QpBoxLinear< InputT >::m_data, shark::QpBoxLinear< InputT >::m_xSquared, and SHARK_ASSERT.
|
inline |
Solve the SVM training problem.
bound | upper bound for alpha-components, complexity parameter of the hinge loss SVM |
reg | coefficient of the penalty term \(-\frac{reg}{2} \cdot \|\alpha\|^2\), reg=1/C where C is the complexity parameter of the squared hinge loss SVM |
stop | stopping condition(s) |
prop | solution properties |
verbose | if true, the solver prints status information and solution statistics |
Definition at line 109 of file QpBoxLinear.h.
References CHANGE_RATE, shark::discrete(), shark::blas::inner_prod(), shark::Timer::lastLap(), shark::QpBoxLinear< InputT >::m_data, shark::QpBoxLinear< InputT >::m_dim, shark::QpBoxLinear< InputT >::m_xSquared, shark::blas::max(), shark::QpStoppingCondition::maxIterations, shark::QpStoppingCondition::maxSeconds, shark::blas::min(), shark::QpStoppingCondition::minAccuracy, PREF_MAX, PREF_MIN, shark::QpAccuracyReached, shark::QpMaxIterationsReached, shark::QpTimeout, SHARK_ASSERT, shark::Timer::start(), shark::Timer::stop(), shark::swap(), shark::uni(), and w.
Referenced by shark::LinearMcSvmOVATrainer< InputType >::train(), shark::LinearCSvmTrainer< InputType >::train(), and shark::SquaredHingeLinearCSvmTrainer< InputType >::train().
|
protected |
view on training data
Definition at line 312 of file QpBoxLinear.h.
Referenced by shark::QpBoxLinear< InputT >::QpBoxLinear(), and shark::QpBoxLinear< InputT >::solve().
|
protected |
input space dimension
Definition at line 314 of file QpBoxLinear.h.
Referenced by shark::QpBoxLinear< InputT >::solve(), and shark::QpBoxLinear< CompressedRealVector >::solve().
|
protected |
diagonal entries of the quadratic matrix
Definition at line 313 of file QpBoxLinear.h.
Referenced by shark::QpBoxLinear< InputT >::QpBoxLinear(), and shark::QpBoxLinear< InputT >::solve().