PEGASOS (PEGASOS SVM solver) More...
#include "generic.h"
Functions | |
void | vl_pegasos_train_binary_svm_d (double *model, double const *data, vl_size dimension, vl_size numSamples, vl_int8 const *labels, double regularizer, double biasMultiplier, vl_uindex startingIteration, vl_size numIterations, VlRand *randomGenerator, vl_uint32 const *permutation, vl_size permutationSize, double const *preconditioner) |
void | vl_pegasos_train_binary_svm_f (float *model, float const *data, vl_size dimension, vl_size numSamples, vl_int8 const *labels, double regularizer, double biasMultiplier, vl_uindex startingIteration, vl_size numIterations, VlRand *randomGenerator, vl_uint32 const *permutation, vl_size permutationSize, float const *preconditioner) |
Detailed Description
Function Documentation
vl_pegasos_train_binary_svm_d | ( | double * | model, |
double const * | data, | ||
vl_size | dimension, | ||
vl_size | numSamples, | ||
vl_int8 const * | labels, | ||
double | regularizer, | ||
double | biasMultiplier, | ||
vl_uindex | startingIteration, | ||
vl_size | numIterations, | ||
VlRand * | randomGenerator, | ||
vl_uint32 const * | permutation, | ||
vl_size | permutationSize, | ||
double const * | preconditioner | ||
) |
- Parameters:
-
model (out) the learned model. data training vectors. dimension data dimension. numSamples number of training data vectors. labels labels of the training vectors. regularizer value of the regularizer coefficient .
biasMultiplier value of the bias multiplier .
startingIteration number of the first iteration. numIterations number of iterations to perform. randomGenerator random number generator. permutation order in which the data is accessed. permutationSize length of permutation
.preconditioner diagonal precoditioner.
The function runs PEGASOS on the specified data. The vector model must have either dimension equal to dimension if biasMultiplier is zero, or dimension + 1 if biasMultiplier is larger than zero.
The function runs PEGASOS for iterations t in the interval [fistIteration, lastIteration]. Together with the fact that the initial model can be set arbitrarily, this enable restarting PEGASOS from any point.
PEGASOS select the next point for computing the gradient at random. If randomGenerator is NULL
, the default random generator (as returned by vl_get_rand()) is used.
Alternatively, if permutation is not NULL
, then points are sampled in the order specified by this vector of indexes (this is cycled through). In this way It is an error to set both randomGenerator and permutation to non-null values.
preconditioner
specifies a diagonal preconditioner for the minimization problem (it is often useful to slow down the steps for the bias term, if the latter is used). Set preconditioner
to NULL to avoid using a preconditioner. The precodnitioner should have the same dimension of the model, plus one if an SVM with bias is learned.
See the Overview overview for details.
vl_pegasos_train_binary_svm_f | ( | float * | model, |
float const * | data, | ||
vl_size | dimension, | ||
vl_size | numSamples, | ||
vl_int8 const * | labels, | ||
double | regularizer, | ||
double | biasMultiplier, | ||
vl_uindex | startingIteration, | ||
vl_size | numIterations, | ||
VlRand * | randomGenerator, | ||
vl_uint32 const * | permutation, | ||
vl_size | permutationSize, | ||
float const * | preconditioner | ||
) |
- See also:
- vl_pegasos_train_binary_svm_d