Pegasos solver for linear multi-class support vector machines. More...
#include <shark/Algorithms/Pegasos.h>
Public Types | |
enum | eMarginType { emRelative, emAbsolute } |
Multi-class margin type. More... | |
enum | eLossType { elNaiveHinge, elDiscriminativeMax, elDiscriminativeSum, elTotalMax, elTotalSum } |
Multi-class loss function type. More... | |
Static Public Member Functions | |
template<class WeightType > | |
static std::size_t | solve (LabeledData< VectorType, unsigned int > const &data, eMarginType margintype, eLossType losstype, bool sumToZero, double C, std::vector< WeightType > &w, std::size_t batchsize=1, double varepsilon=0.001) |
Solve the primal multi-class SVM problem. More... | |
Protected Types | |
typedef bool(* | LossGradientFunction) (VectorType const &, unsigned int, RealVector const &, std::vector< VectorType > &, bool) |
Static Protected Member Functions | |
static bool | lossGradientANH (VectorType const &x, unsigned int y, RealVector const &f, std::vector< VectorType > &gradient, bool sumToZero) |
static bool | lossGradientRDM (VectorType const &x, unsigned int y, RealVector const &f, std::vector< VectorType > &gradient, bool sumToZero) |
static bool | lossGradientRDS (VectorType const &x, unsigned int y, RealVector const &f, std::vector< VectorType > &gradient, bool sumToZero) |
static bool | lossGradientADS (VectorType const &x, unsigned int y, RealVector const &f, std::vector< VectorType > &gradient, bool sumToZero) |
static bool | lossGradientADM (VectorType const &x, unsigned int y, RealVector const &f, std::vector< VectorType > &gradient, bool sumToZero) |
static bool | lossGradientATS (VectorType const &x, unsigned int y, RealVector const &f, std::vector< VectorType > &gradient, bool sumToZero) |
static bool | lossGradientATM (VectorType const &x, unsigned int y, RealVector const &f, std::vector< VectorType > &gradient, bool sumToZero) |
Pegasos solver for linear multi-class support vector machines.
|
protected |
enum shark::McPegasos::eLossType |
enum shark::McPegasos::eMarginType |
|
inlinestaticprotected |
Definition at line 483 of file Pegasos.h.
References shark::blas::max().
|
inlinestaticprotected |
Definition at line 456 of file Pegasos.h.
References shark::mean().
|
inlinestaticprotected |
|
inlinestaticprotected |
Definition at line 553 of file Pegasos.h.
References shark::blas::max().
|
inlinestaticprotected |
Definition at line 515 of file Pegasos.h.
References shark::mean().
|
inlinestaticprotected |
Definition at line 408 of file Pegasos.h.
References shark::blas::max().
|
inlinestaticprotected |
|
inlinestatic |
Solve the primal multi-class SVM problem.
In addition to "standard" Pegasos this solver checks a meaningful stopping criterion.
The function returns the number of model predictions during training (this is comparable to SMO iterations).
data | training data |
margintype | margin function type |
losstype | loss function type |
sumToZero | enforce the sum-to-zero constraint? |
C | SVM regularization parameter |
w | class-wise weight vectors |
batchsize | number of samples in each gradient estimate |
varepsilon | solution accuracy (factor by which the primal gradient should be reduced) |
Definition at line 220 of file Pegasos.h.
References shark::discrete(), shark::blas::inner_prod(), lambda, shark::Pegasos< VectorType >::lg(), shark::blas::noalias(), shark::LabeledData< InputT, LabelT >::numberOfElements(), SHARK_ASSERT, SHARKEXCEPTION, and shark::size().