Super class of all kernelized (non-linear) SVM trainers. More...
#include <shark/Algorithms/Trainers/AbstractSvmTrainer.h>
Inheritance diagram for shark::AbstractSvmTrainer< InputType, LabelType, Model, Trainer >:Public Types | |
| typedef AbstractKernelFunction< InputType > | KernelType |
Public Member Functions | |
| AbstractSvmTrainer (KernelType *kernel, double C, bool offset, bool unconstrained=false) | |
| AbstractSvmTrainer (KernelType *kernel, double negativeC, double positiveC, bool offset, bool unconstrained=false) | |
| double | C () const |
| Return the value of the regularization parameter C. More... | |
| RealVector const & | regularizationParameters () const |
| RealVector & | regularizationParameters () |
| KernelType * | kernel () |
| const KernelType * | kernel () const |
| void | setKernel (KernelType *kernel) |
| bool | isUnconstrained () const |
| bool | trainOffset () const |
| double | CacheSize () const |
| void | setCacheSize (std::size_t size) |
| RealVector | parameterVector () const |
| get the hyper-parameter vector More... | |
| void | setParameterVector (RealVector const &newParameters) |
| set the vector of hyper-parameters More... | |
| size_t | numberOfParameters () const |
| return the number of hyper-parameters More... | |
Public Member Functions inherited from shark::QpConfig | |
| QpConfig (bool precomputedFlag=false, bool sparsifyFlag=true) | |
| Constructor. More... | |
| QpStoppingCondition & | stoppingCondition () |
| Read/write access to the stopping condition. More... | |
| QpStoppingCondition const & | stoppingCondition () const |
| Read access to the stopping condition. More... | |
| QpSolutionProperties & | solutionProperties () |
| Access to the solution properties. More... | |
| bool & | precomputeKernel () |
| Flag for using a precomputed kernel matrix. More... | |
| bool const & | precomputeKernel () const |
| Flag for using a precomputed kernel matrix. More... | |
| bool & | sparsify () |
| Flag for sparsifying the model after training. More... | |
| bool const & | sparsify () const |
| Flag for sparsifying the model after training. More... | |
| bool & | shrinking () |
| Flag for shrinking in the decomposition solver. More... | |
| bool const & | shrinking () const |
| Flag for shrinking in the decomposition solver. More... | |
| bool & | s2do () |
| Flag for S2DO (instead of SMO) More... | |
| bool const & | s2do () const |
| Flag for S2DO (instead of SMO) More... | |
| unsigned int & | verbosity () |
| Verbosity level of the solver. More... | |
| unsigned int const & | verbosity () const |
| Verbosity level of the solver. More... | |
| unsigned long long const & | accessCount () const |
| Number of kernel accesses. More... | |
| void | setMinAccuracy (double a) |
| void | setMaxIterations (unsigned long long i) |
| void | setTargetValue (double v) |
| void | setMaxSeconds (double s) |
Public Member Functions inherited from shark::IParameterizable | |
| virtual | ~IParameterizable () |
Protected Attributes | |
| KernelType * | m_kernel |
| RealVector | m_regularizers |
| Vector of regularization parameters. More... | |
| bool | m_trainOffset |
| bool | m_unconstrained |
| Is log(C) stored internally as a parameter instead of C? If yes, then we get rid of the constraint C > 0 on the level of the parameter interface. More... | |
| std::size_t | m_cacheSize |
| Number of values in the kernel cache. The size of the cache in bytes is the size of one entry (4 for float, 8 for double) times this number. More... | |
Protected Attributes inherited from shark::QpConfig | |
| QpStoppingCondition | m_stoppingcondition |
| conditions for when to stop the QP solver More... | |
| QpSolutionProperties | m_solutionproperties |
| properties of the approximate solution found by the solver More... | |
| bool | m_precomputedKernelMatrix |
| should the solver use a precomputed kernel matrix? More... | |
| bool | m_sparsify |
| should the trainer sparsify the model after training? More... | |
| bool | m_shrinking |
| should shrinking be used? More... | |
| bool | m_s2do |
| should S2DO be used instead of SMO? More... | |
| unsigned int | m_verbosity |
| verbosity level (currently unused) More... | |
| unsigned long long | m_accessCount |
| kernel access count More... | |
Super class of all kernelized (non-linear) SVM trainers.
Definition at line 185 of file AbstractSvmTrainer.h.
| typedef AbstractKernelFunction<InputType> shark::AbstractSvmTrainer< InputType, LabelType, Model, Trainer >::KernelType |
Definition at line 189 of file AbstractSvmTrainer.h.
|
inline |
Constructor
| kernel | kernel function to use for training and prediction |
| C | regularization parameter - always the 'true' value of C, even when unconstrained is set |
| offset | train svm with offset - this is not supported for all SVM solvers. |
| unconstrained | when a C-value is given via setParameter, should it be piped through the exp-function before using it in the solver? |
Definition at line 196 of file AbstractSvmTrainer.h.
|
inline |
Constructor featuring two regularization parameters
| kernel | kernel function to use for training and prediction |
| negativeC | regularization parameter of the negative class (label 0) |
| positiveC | regularization parameter of the positive class (label 1) |
| offset | train svm with offset - this is not supported for all SVM solvers. |
| unconstrained | when a C-value is given via setParameter, should it be piped through the exp-function before using it in the solver? |
Definition at line 210 of file AbstractSvmTrainer.h.
|
inline |
Return the value of the regularization parameter C.
Definition at line 225 of file AbstractSvmTrainer.h.
|
inline |
Definition at line 254 of file AbstractSvmTrainer.h.
|
inline |
Definition at line 248 of file AbstractSvmTrainer.h.
|
inline |
Definition at line 241 of file AbstractSvmTrainer.h.
Referenced by shark::CSvmDerivative< InputType, CacheType >::CSvmDerivative().
|
inline |
Definition at line 243 of file AbstractSvmTrainer.h.
|
inlinevirtual |
return the number of hyper-parameters
Reimplemented from shark::IParameterizable.
Definition at line 282 of file AbstractSvmTrainer.h.
|
inlinevirtual |
get the hyper-parameter vector
Reimplemented from shark::IParameterizable.
Definition at line 260 of file AbstractSvmTrainer.h.
|
inline |
Definition at line 231 of file AbstractSvmTrainer.h.
|
inline |
Definition at line 236 of file AbstractSvmTrainer.h.
|
inline |
Definition at line 256 of file AbstractSvmTrainer.h.
|
inline |
Definition at line 245 of file AbstractSvmTrainer.h.
|
inlinevirtual |
set the vector of hyper-parameters
Reimplemented from shark::IParameterizable.
Definition at line 272 of file AbstractSvmTrainer.h.
|
inline |
Definition at line 251 of file AbstractSvmTrainer.h.
|
protected |
Number of values in the kernel cache. The size of the cache in bytes is the size of one entry (4 for float, 8 for double) times this number.
Definition at line 297 of file AbstractSvmTrainer.h.
|
protected |
Kernel object.
Definition at line 287 of file AbstractSvmTrainer.h.
|
protected |
Vector of regularization parameters.
If the size of the vector is 1 there is only one regularization parameter for all classes, else there must be one for every class in the dataset. The exact meaning depends on the sub-class, but the value is always positive, and higher implies a less regular solution.
Definition at line 294 of file AbstractSvmTrainer.h.
|
protected |
Definition at line 295 of file AbstractSvmTrainer.h.
|
protected |
Is log(C) stored internally as a parameter instead of C? If yes, then we get rid of the constraint C > 0 on the level of the parameter interface.
Definition at line 296 of file AbstractSvmTrainer.h.