Problem formulation for binary C-SVM problems. More...
#include <shark/Algorithms/QP/QpSolver.h>
| Public Types | |
| typedef MatrixT | MatrixType | 
| typedef MatrixType::QpFloatType | QpFloatType | 
| Public Member Functions | |
| CSVMProblem (MatrixType &quadratic, Data< unsigned int > const &labels, double C) | |
| Setup only using kernel matrix, labels and regularization parameter. | |
| CSVMProblem (MatrixType &quadratic, Data< unsigned int > const &labels, RealVector const ®ularizers) | |
| Setup using kernel matrix, labels and different regularization parameters for positive and negative classes. | |
| CSVMProblem (MatrixType &quadratic, RealVector linear, Data< unsigned int > const &labels, double C) | |
| std::size_t | dimensions () const | 
| double | boxMin (std::size_t i) const | 
| double | boxMax (std::size_t i) const | 
| void | flipCoordinates (std::size_t i, std::size_t j) | 
| exchange two variables via the permutation | |
| void | scaleBoxConstraints (double factor, double variableScalingFactor) | 
| Scales all box constraints by a constant factor and adapts the solution by scaling it by the same factor. | |
| Public Attributes | |
| MatrixType & | quadratic | 
| representation of the quadratic part of the objective function | |
| RealVector | linear | 
| Linear part of the problem. | |
| RealVector | alpha | 
| Solution candidate. | |
| RealVector | diagonal | 
| std::vector< std::size_t > | permutation | 
| permutation of the variables alpha, gradient, etc. | |
Problem formulation for binary C-SVM problems.
\(max_\alpha - 1/2 \alpha^T K \alpha + \alpha^Ty\) under constraints: \(l_i <= \alpha_i <= u_i\) \(\sum_i \alpha_i = 0\)
Definition at line 246 of file QpSolver.h.
| typedef MatrixT shark::CSVMProblem< MatrixT >::MatrixType | 
Definition at line 248 of file QpSolver.h.
| typedef MatrixType::QpFloatType shark::CSVMProblem< MatrixT >::QpFloatType | 
Definition at line 249 of file QpSolver.h.
| 
 | inline | 
Setup only using kernel matrix, labels and regularization parameter.
Definition at line 252 of file QpSolver.h.
References shark::CSVMProblem< MatrixT >::diagonal, shark::CSVMProblem< MatrixT >::dimensions(), shark::Data< Type >::element(), shark::CSVMProblem< MatrixT >::linear, shark::Data< Type >::numberOfElements(), shark::CSVMProblem< MatrixT >::permutation, shark::CSVMProblem< MatrixT >::quadratic, and SIZE_CHECK.
| 
 | inline | 
Setup using kernel matrix, labels and different regularization parameters for positive and negative classes.
Definition at line 274 of file QpSolver.h.
References shark::CSVMProblem< MatrixT >::diagonal, shark::CSVMProblem< MatrixT >::dimensions(), shark::Data< Type >::element(), shark::CSVMProblem< MatrixT >::linear, shark::Data< Type >::numberOfElements(), shark::CSVMProblem< MatrixT >::permutation, shark::CSVMProblem< MatrixT >::quadratic, and SIZE_CHECK.
| 
 | inline | 
Definition at line 302 of file QpSolver.h.
References shark::CSVMProblem< MatrixT >::diagonal, shark::CSVMProblem< MatrixT >::dimensions(), shark::Data< Type >::element(), shark::CSVMProblem< MatrixT >::linear, shark::Data< Type >::numberOfElements(), shark::CSVMProblem< MatrixT >::permutation, shark::CSVMProblem< MatrixT >::quadratic, and SIZE_CHECK.
| 
 | inline | 
Definition at line 330 of file QpSolver.h.
| 
 | inline | 
Definition at line 327 of file QpSolver.h.
| 
 | inline | 
Definition at line 323 of file QpSolver.h.
References shark::CSVMProblem< MatrixT >::quadratic.
Referenced by shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::CSVMProblem< MatrixT >::CSVMProblem(), and shark::CSVMProblem< MatrixT >::scaleBoxConstraints().
| 
 | inline | 
exchange two variables via the permutation
Definition at line 351 of file QpSolver.h.
References shark::CSVMProblem< MatrixT >::alpha, shark::CSVMProblem< MatrixT >::diagonal, shark::CSVMProblem< MatrixT >::linear, shark::CSVMProblem< MatrixT >::permutation, and shark::CSVMProblem< MatrixT >::quadratic.
| 
 | inline | 
Scales all box constraints by a constant factor and adapts the solution by scaling it by the same factor.
Definition at line 365 of file QpSolver.h.
References shark::CSVMProblem< MatrixT >::alpha, and shark::CSVMProblem< MatrixT >::dimensions().
| RealVector shark::CSVMProblem< MatrixT >::alpha | 
Solution candidate.
Definition at line 341 of file QpSolver.h.
Referenced by shark::CSVMProblem< MatrixT >::flipCoordinates(), and shark::CSVMProblem< MatrixT >::scaleBoxConstraints().
| RealVector shark::CSVMProblem< MatrixT >::diagonal | 
diagonal matrix entries The diagonal array is of fixed size and not subject to shrinking.
Definition at line 345 of file QpSolver.h.
Referenced by shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::CSVMProblem< MatrixT >::CSVMProblem(), and shark::CSVMProblem< MatrixT >::flipCoordinates().
| RealVector shark::CSVMProblem< MatrixT >::linear | 
Linear part of the problem.
Definition at line 338 of file QpSolver.h.
Referenced by shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::CSVMProblem< MatrixT >::CSVMProblem(), and shark::CSVMProblem< MatrixT >::flipCoordinates().
| std::vector<std::size_t> shark::CSVMProblem< MatrixT >::permutation | 
permutation of the variables alpha, gradient, etc.
Definition at line 348 of file QpSolver.h.
Referenced by shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::CSVMProblem< MatrixT >::CSVMProblem(), and shark::CSVMProblem< MatrixT >::flipCoordinates().
| MatrixType& shark::CSVMProblem< MatrixT >::quadratic | 
representation of the quadratic part of the objective function
Definition at line 335 of file QpSolver.h.
Referenced by shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::CSVMProblem< MatrixT >::dimensions(), and shark::CSVMProblem< MatrixT >::flipCoordinates().