Quadratic Problem with only Box-Constraints Let K the kernel matrix, than the problem has the form. More...
#include <shark/Algorithms/QP/QpSolver.h>
Public Types | |
typedef MatrixT | MatrixType |
typedef MatrixType::QpFloatType | QpFloatType |
Public Member Functions | |
GeneralQuadraticProblem (MatrixType &quadratic) | |
GeneralQuadraticProblem (MatrixType &quadratic, Data< unsigned int > const &labels, Data< double > const &weights, RealVector const ®ularizers) | |
constructor which initializes a C-SVM problem with weighted datapoints and different regularizers for every class More... | |
std::size_t | dimensions () const |
void | flipCoordinates (std::size_t i, std::size_t j) |
exchange two variables via the permutation More... | |
void | scaleBoxConstraints (double factor) |
Scales all box constraints by a constant factor and adapts the solution by scaling it by the same factor. More... | |
Public Attributes | |
MatrixType & | quadratic |
representation of the quadratic part of the objective function More... | |
RealVector | linear |
Linear part of the problem. More... | |
RealVector | alpha |
Solution candidate. More... | |
RealVector | diagonal |
std::vector< std::size_t > | permutation |
permutation of the variables alpha, gradient, etc. More... | |
RealVector | boxMin |
component-wise lower bound More... | |
RealVector | boxMax |
component-wise upper bound More... | |
Quadratic Problem with only Box-Constraints Let K the kernel matrix, than the problem has the form.
max_ - 1/2 ^T K + ^Tv under constraints: l_i <= <= u_i
Definition at line 52 of file QpSolver.h.
typedef MatrixT shark::GeneralQuadraticProblem< MatrixT >::MatrixType |
Definition at line 54 of file QpSolver.h.
typedef MatrixType::QpFloatType shark::GeneralQuadraticProblem< MatrixT >::QpFloatType |
Definition at line 55 of file QpSolver.h.
|
inline |
Definition at line 58 of file QpSolver.h.
References shark::GeneralQuadraticProblem< MatrixT >::diagonal, shark::GeneralQuadraticProblem< MatrixT >::dimensions(), and shark::GeneralQuadraticProblem< MatrixT >::permutation.
|
inline |
constructor which initializes a C-SVM problem with weighted datapoints and different regularizers for every class
Definition at line 74 of file QpSolver.h.
References shark::GeneralQuadraticProblem< MatrixT >::boxMax, shark::GeneralQuadraticProblem< MatrixT >::boxMin, shark::GeneralQuadraticProblem< MatrixT >::diagonal, shark::GeneralQuadraticProblem< MatrixT >::dimensions(), shark::Data< Type >::element(), shark::GeneralQuadraticProblem< MatrixT >::linear, shark::Data< Type >::numberOfElements(), shark::GeneralQuadraticProblem< MatrixT >::permutation, and SIZE_CHECK.
|
inline |
Definition at line 110 of file QpSolver.h.
References shark::GeneralQuadraticProblem< MatrixT >::quadratic.
Referenced by shark::BoxedSVMProblem< MatrixT >::BoxedSVMProblem(), shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::GeneralQuadraticProblem< MatrixT >::GeneralQuadraticProblem(), shark::CSVMProblem< MatrixT >::scaleBoxConstraints(), and shark::RankingSvmTrainer< InputType, CacheType >::train().
|
inline |
exchange two variables via the permutation
Definition at line 115 of file QpSolver.h.
References shark::GeneralQuadraticProblem< MatrixT >::alpha, shark::GeneralQuadraticProblem< MatrixT >::boxMax, shark::GeneralQuadraticProblem< MatrixT >::boxMin, shark::GeneralQuadraticProblem< MatrixT >::diagonal, shark::GeneralQuadraticProblem< MatrixT >::linear, shark::GeneralQuadraticProblem< MatrixT >::permutation, shark::GeneralQuadraticProblem< MatrixT >::quadratic, and shark::swap().
|
inline |
Scales all box constraints by a constant factor and adapts the solution by scaling it by the same factor.
Definition at line 130 of file QpSolver.h.
References shark::GeneralQuadraticProblem< MatrixT >::alpha, shark::GeneralQuadraticProblem< MatrixT >::boxMax, and shark::GeneralQuadraticProblem< MatrixT >::boxMin.
RealVector shark::GeneralQuadraticProblem< MatrixT >::alpha |
Solution candidate.
Definition at line 143 of file QpSolver.h.
Referenced by shark::GeneralQuadraticProblem< MatrixT >::flipCoordinates(), shark::GeneralQuadraticProblem< MatrixT >::scaleBoxConstraints(), and shark::CSVMProblem< MatrixT >::scaleBoxConstraints().
RealVector shark::GeneralQuadraticProblem< MatrixT >::boxMax |
component-wise upper bound
Definition at line 156 of file QpSolver.h.
Referenced by shark::GeneralQuadraticProblem< MatrixT >::flipCoordinates(), shark::GeneralQuadraticProblem< MatrixT >::GeneralQuadraticProblem(), shark::GeneralQuadraticProblem< MatrixT >::scaleBoxConstraints(), and shark::RankingSvmTrainer< InputType, CacheType >::train().
RealVector shark::GeneralQuadraticProblem< MatrixT >::boxMin |
component-wise lower bound
Definition at line 153 of file QpSolver.h.
Referenced by shark::GeneralQuadraticProblem< MatrixT >::flipCoordinates(), shark::GeneralQuadraticProblem< MatrixT >::GeneralQuadraticProblem(), shark::GeneralQuadraticProblem< MatrixT >::scaleBoxConstraints(), and shark::RankingSvmTrainer< InputType, CacheType >::train().
RealVector shark::GeneralQuadraticProblem< MatrixT >::diagonal |
diagonal matrix entries The diagonal array is of fixed size and not subject to shrinking.
Definition at line 147 of file QpSolver.h.
Referenced by shark::BoxedSVMProblem< MatrixT >::BoxedSVMProblem(), shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::GeneralQuadraticProblem< MatrixT >::flipCoordinates(), and shark::GeneralQuadraticProblem< MatrixT >::GeneralQuadraticProblem().
RealVector shark::GeneralQuadraticProblem< MatrixT >::linear |
Linear part of the problem.
Definition at line 140 of file QpSolver.h.
Referenced by shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::GeneralQuadraticProblem< MatrixT >::flipCoordinates(), shark::GeneralQuadraticProblem< MatrixT >::GeneralQuadraticProblem(), and shark::RankingSvmTrainer< InputType, CacheType >::train().
std::vector<std::size_t> shark::GeneralQuadraticProblem< MatrixT >::permutation |
permutation of the variables alpha, gradient, etc.
Definition at line 150 of file QpSolver.h.
Referenced by shark::BoxedSVMProblem< MatrixT >::BoxedSVMProblem(), shark::CSVMProblem< MatrixT >::CSVMProblem(), shark::GeneralQuadraticProblem< MatrixT >::flipCoordinates(), shark::BoxedSVMProblem< MatrixT >::flipCoordinates(), and shark::GeneralQuadraticProblem< MatrixT >::GeneralQuadraticProblem().
MatrixType& shark::GeneralQuadraticProblem< MatrixT >::quadratic |
representation of the quadratic part of the objective function
Definition at line 137 of file QpSolver.h.
Referenced by shark::GeneralQuadraticProblem< MatrixT >::dimensions(), shark::BoxedSVMProblem< MatrixT >::dimensions(), shark::CSVMProblem< MatrixT >::dimensions(), and shark::GeneralQuadraticProblem< MatrixT >::flipCoordinates().