shark::QpMcLinearADM< InputT > Class Template Reference

Solver for the multi-class SVM with absolute margin and discriminative maximum loss. More...

#include <shark/Algorithms/QP/QpMcLinear.h>

+ Inheritance diagram for shark::QpMcLinearADM< InputT >:

Public Types

typedef LabeledData< InputT, unsigned int > DatasetType
 
- Public Types inherited from shark::QpMcLinear< InputT >
enum  CoordinateSelectionStrategy { UNIFORM, ACF }
 
typedef LabeledData< InputT, unsigned int > DatasetType
 
typedef LabeledData< InputT, unsigned int >::const_element_reference ElementType
 
typedef Batch< InputT >::const_reference InputReferenceType
 

Public Member Functions

 QpMcLinearADM (const DatasetType &dataset, std::size_t dim, std::size_t classes)
 Constructor. More...
 
- Public Member Functions inherited from shark::QpMcLinear< InputT >
 QpMcLinear (const DatasetType &dataset, std::size_t dim, std::size_t classes, std::size_t strategy=ACF, bool shrinking=false)
 Constructor. More...
 
RealMatrix solve (random::rng_type &rng, double C, QpStoppingCondition &stop, QpSolutionProperties *prop=NULL, bool verbose=false)
 Solve the SVM training problem. More...
 

Protected Member Functions

virtual double calcGradient (RealVector &gradient, RealVector wx, blas::matrix_row< RealMatrix > const &alpha, double C, unsigned int y)
 Compute the gradient from the inner products of the weight vectors with the current sample. More...
 
virtual void updateWeightVectors (RealMatrix &w, RealVector const &mu, std::size_t index)
 Update the weight vectors (primal variables) after a step on the dual variables. More...
 
virtual double solveSub (double epsilon, RealVector gradient, double q, double C, unsigned int y, blas::matrix_row< RealMatrix > &alpha, RealVector &mu)
 Solve the sub-problem posed by a single training example. More...
 
- Protected Member Functions inherited from shark::QpMcLinear< InputT >
void add_scaled (RealMatrix &w, RealVector const &mu, InputReferenceType x)
 

Additional Inherited Members

- Protected Attributes inherited from shark::QpMcLinear< InputT >
DataView< const DatasetTypem_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...
 
std::size_t m_classes
 number of classes More...
 
std::size_t m_strategy
 strategy for coordinate selection More...
 
bool m_shrinking
 apply shrinking or not? More...
 

Detailed Description

template<class InputT>
class shark::QpMcLinearADM< InputT >

Solver for the multi-class SVM with absolute margin and discriminative maximum loss.

Definition at line 1009 of file QpMcLinear.h.

Member Typedef Documentation

◆ DatasetType

template<class InputT >
typedef LabeledData<InputT, unsigned int> shark::QpMcLinearADM< InputT >::DatasetType

Definition at line 1012 of file QpMcLinear.h.

Constructor & Destructor Documentation

◆ QpMcLinearADM()

template<class InputT >
shark::QpMcLinearADM< InputT >::QpMcLinearADM ( const DatasetType dataset,
std::size_t  dim,
std::size_t  classes 
)
inline

Constructor.

Definition at line 1015 of file QpMcLinear.h.

Member Function Documentation

◆ calcGradient()

template<class InputT >
virtual double shark::QpMcLinearADM< InputT >::calcGradient ( RealVector &  gradient,
RealVector  wx,
blas::matrix_row< RealMatrix > const &  alpha,
double  C,
unsigned int  y 
)
inlineprotectedvirtual

Compute the gradient from the inner products of the weight vectors with the current sample.

Implements shark::QpMcLinear< InputT >.

Definition at line 1024 of file QpMcLinear.h.

References shark::QpMcLinear< InputT >::m_classes.

◆ solveSub()

template<class InputT >
virtual double shark::QpMcLinearADM< InputT >::solveSub ( double  epsilon,
RealVector  gradient,
double  q,
double  C,
unsigned int  y,
blas::matrix_row< RealMatrix > &  alpha,
RealVector &  mu 
)
inlineprotectedvirtual

Solve the sub-problem posed by a single training example.

Implements shark::QpMcLinear< InputT >.

Definition at line 1078 of file QpMcLinear.h.

References shark::QpMcLinear< InputT >::m_classes.

◆ updateWeightVectors()

template<class InputT >
virtual void shark::QpMcLinearADM< InputT >::updateWeightVectors ( RealMatrix &  w,
RealVector const &  mu,
std::size_t  index 
)
inlineprotectedvirtual

Update the weight vectors (primal variables) after a step on the dual variables.

Implements shark::QpMcLinear< InputT >.

Definition at line 1067 of file QpMcLinear.h.

References shark::QpMcLinear< InputT >::add_scaled(), shark::QpMcLinear< InputT >::m_classes, and shark::QpMcLinear< InputT >::m_data.


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