#include <shark/Algorithms/QP/QpBoxLinear.h>
Classes | |
struct | SparseVector |
Data structure for sparse vectors. More... | |
Public Types | |
typedef LabeledData< CompressedRealVector, unsigned int > | DatasetType |
Public Member Functions | |
QpBoxLinear (const DatasetType &dataset, std::size_t dim) | |
Constructor. More... | |
RealVector | solve (double C, QpStoppingCondition &stop, QpSolutionProperties *prop=NULL, bool verbose=false) |
Solve the SVM training problem. More... | |
Static Protected Member Functions | |
static void | axpy (RealVector &w, double alpha, const SparseVector *xi) |
Famous "axpy" product, here adding a multiple of a sparse vector to a dense one. More... | |
static double | inner_prod (RealVector const &w, const SparseVector *xi) |
Inner product between a dense and a sparse vector. More... | |
Protected Attributes | |
std::vector< SparseVector > | storage |
storage for sparse vectors More... | |
std::vector< SparseVector * > | x |
sparse vectors More... | |
RealVector | y |
+1/-1 labels More... | |
RealVector | diagonal |
diagonal entries of the quadratic matrix More... | |
std::size_t | m_dim |
input space dimension More... | |
Definition at line 315 of file QpBoxLinear.h.
typedef LabeledData<CompressedRealVector, unsigned int> shark::QpBoxLinear< CompressedRealVector >::DatasetType |
Definition at line 318 of file QpBoxLinear.h.
|
inline |
Constructor.
dataset | training data |
dim | problem dimension |
Definition at line 326 of file QpBoxLinear.h.
References shark::LabeledData< InputT, LabelT >::batch(), shark::LabeledData< InputT, LabelT >::element(), shark::get(), shark::LabeledData< InputT, LabelT >::numberOfBatches(), and SHARK_ASSERT.
|
inlinestaticprotected |
Famous "axpy" product, here adding a multiple of a sparse vector to a dense one.
Definition at line 591 of file QpBoxLinear.h.
|
inlinestaticprotected |
Inner product between a dense and a sparse vector.
Definition at line 602 of file QpBoxLinear.h.
|
inline |
Solve the SVM training problem.
C | regularization constant of the SVM |
stop | stopping condition(s) |
prop | solution properties |
verbose | if true, the solver prints status information and solution statistics |
Definition at line 383 of file QpBoxLinear.h.
References CHANGE_RATE, shark::blas::inner_prod(), shark::Timer::lastLap(), shark::QpBoxLinear< InputT >::m_dim, 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(), and w.
|
protected |
diagonal entries of the quadratic matrix
Definition at line 616 of file QpBoxLinear.h.
|
protected |
input space dimension
Definition at line 617 of file QpBoxLinear.h.
|
protected |
storage for sparse vectors
Definition at line 613 of file QpBoxLinear.h.
|
protected |
sparse vectors
Definition at line 614 of file QpBoxLinear.h.
|
protected |
+1/-1 labels
Definition at line 615 of file QpBoxLinear.h.