Pegasos solver for linear multi-class support vector machines.
More...
#include <shark/Algorithms/Pegasos.h>
|
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...
|
|
|
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) |
|
template<class VectorType>
class shark::McPegasos< VectorType >
Pegasos solver for linear multi-class support vector machines.
Definition at line 192 of file Pegasos.h.
◆ LossGradientFunction
template<class VectorType >
◆ eLossType
template<class VectorType >
Multi-class loss function type.
Enumerator |
---|
elNaiveHinge | |
elDiscriminativeMax | |
elDiscriminativeSum | |
elTotalMax | |
elTotalSum | |
Definition at line 203 of file Pegasos.h.
◆ eMarginType
template<class VectorType >
Multi-class margin type.
Enumerator |
---|
emRelative | |
emAbsolute | |
Definition at line 196 of file Pegasos.h.
◆ lossGradientADM()
template<class VectorType >
◆ lossGradientADS()
template<class VectorType >
◆ lossGradientANH()
template<class VectorType >
◆ lossGradientATM()
template<class VectorType >
◆ lossGradientATS()
template<class VectorType >
◆ lossGradientRDM()
template<class VectorType >
◆ lossGradientRDS()
template<class VectorType >
◆ solve()
template<class VectorType >
template<class WeightType >
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).
- Parameters
-
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 lambda, shark::Pegasos< VectorType >::lg(), shark::LabeledData< InputT, LabelT >::numberOfElements(), SHARK_ASSERT, and SHARK_RUNTIME_CHECK.
The documentation for this class was generated from the following file: