shark::QpBoxLinear< CompressedRealVector > Class Template Reference

#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...
 

Detailed Description

template<>
class shark::QpBoxLinear< CompressedRealVector >

Definition at line 315 of file QpBoxLinear.h.

Member Typedef Documentation

typedef LabeledData<CompressedRealVector, unsigned int> shark::QpBoxLinear< CompressedRealVector >::DatasetType

Definition at line 318 of file QpBoxLinear.h.

Constructor & Destructor Documentation

shark::QpBoxLinear< CompressedRealVector >::QpBoxLinear ( const DatasetType dataset,
std::size_t  dim 
)
inline

Member Function Documentation

static void shark::QpBoxLinear< CompressedRealVector >::axpy ( RealVector &  w,
double  alpha,
const SparseVector *  xi 
)
inlinestaticprotected

Famous "axpy" product, here adding a multiple of a sparse vector to a dense one.

Definition at line 591 of file QpBoxLinear.h.

static double shark::QpBoxLinear< CompressedRealVector >::inner_prod ( RealVector const &  w,
const SparseVector *  xi 
)
inlinestaticprotected

Inner product between a dense and a sparse vector.

Definition at line 602 of file QpBoxLinear.h.

RealVector shark::QpBoxLinear< CompressedRealVector >::solve ( double  C,
QpStoppingCondition stop,
QpSolutionProperties prop = NULL,
bool  verbose = false 
)
inline

Solve the SVM training problem.

Parameters
Cregularization constant of the SVM
stopstopping condition(s)
propsolution properties
verboseif 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.

Member Data Documentation

RealVector shark::QpBoxLinear< CompressedRealVector >::diagonal
protected

diagonal entries of the quadratic matrix

Definition at line 616 of file QpBoxLinear.h.

std::size_t shark::QpBoxLinear< CompressedRealVector >::m_dim
protected

input space dimension

Definition at line 617 of file QpBoxLinear.h.

std::vector<SparseVector> shark::QpBoxLinear< CompressedRealVector >::storage
protected

storage for sparse vectors

Definition at line 613 of file QpBoxLinear.h.

std::vector<SparseVector*> shark::QpBoxLinear< CompressedRealVector >::x
protected

sparse vectors

Definition at line 614 of file QpBoxLinear.h.

RealVector shark::QpBoxLinear< CompressedRealVector >::y
protected

+1/-1 labels

Definition at line 615 of file QpBoxLinear.h.


The documentation for this class was generated from the following file: