#include <shark/Algorithms/QP/SvmProblems.h>
Public Types | |
typedef base_type::QpFloatType | QpFloatType |
typedef base_type::MatrixType | MatrixType |
typedef base_type::PreferedSelectionStrategy | PreferedSelectionStrategy |
![]() | |
typedef Problem::QpFloatType | QpFloatType |
typedef Problem::MatrixType | MatrixType |
typedef LibSVMSelectionCriterion | PreferedSelectionStrategy |
Public Member Functions | |
SvmShrinkingProblem (Problem &problem, bool shrink=true) | |
bool | shrink (double epsilon) |
void | unshrink () |
Unshrink the problem. More... | |
void | setShrinking (bool shrinking) |
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. More... | |
virtual void | setLinear (std::size_t i, double newValue) |
adapts the linear part of the problem and updates the internal data structures accordingly. More... | |
![]() | |
SvmProblem (Problem &problem) | |
std::size_t | dimensions () const |
std::size_t | active () const |
double | boxMin (std::size_t i) const |
double | boxMax (std::size_t i) const |
bool | isLowerBound (std::size_t i) const |
bool | isUpperBound (std::size_t i) const |
MatrixType & | quadratic () |
representation of the quadratic part of the objective function More... | |
double | linear (std::size_t i) const |
double | alpha (std::size_t i) const |
double | diagonal (std::size_t i) const |
double | gradient (std::size_t i) const |
std::size_t | permutation (std::size_t i) const |
RealVector | getUnpermutedAlpha () const |
void | updateSMO (std::size_t i, std::size_t j) |
Does an update of SMO given a working set with indices i and j. More... | |
double | functionValue () const |
Returns the current function value of the problem. More... | |
bool | shrink (double) |
void | reshrink () |
void | unshrink () |
void | deactivateVariable (std::size_t i) |
Remove the i-th example from the problem while taking the equality constraint into account. More... | |
void | activateVariable (std::size_t i) |
Reactivate an previously deactivated variable. More... | |
void | flipCoordinates (std::size_t i, std::size_t j) |
exchange two variables via the permutation More... | |
void | scaleBoxConstraints (double factor, double variableScalingFactor) |
Scales all box constraints by a constant factor and adapts the solution using a separate scaling. More... | |
double | checkKKT () const |
Protected Member Functions | |
virtual void | applyStep (std::size_t i, std::size_t j, double step) |
Update the problem by a proposed step i taking the box constraints into account. More... | |
![]() | |
void | updateAlphaStatus (std::size_t i) |
Additional Inherited Members | |
![]() | |
Problem | m_problem |
RealVector | m_gradient |
gradient of the objective function at the current alpha More... | |
std::size_t | m_active |
std::vector< char > | m_alphaStatus |
Stores the status, whther alpha is on the lower or upper bound, or whether it is free. More... | |
Definition at line 538 of file SvmProblems.h.
typedef base_type::MatrixType shark::SvmShrinkingProblem< Problem >::MatrixType |
Definition at line 543 of file SvmProblems.h.
typedef base_type::PreferedSelectionStrategy shark::SvmShrinkingProblem< Problem >::PreferedSelectionStrategy |
Definition at line 544 of file SvmProblems.h.
typedef base_type::QpFloatType shark::SvmShrinkingProblem< Problem >::QpFloatType |
Definition at line 542 of file SvmProblems.h.
|
inline |
Definition at line 546 of file SvmProblems.h.
|
inlineprotectedvirtual |
Update the problem by a proposed step i taking the box constraints into account.
A step length 0<=lambda<=1 is found so that boxMin(i) <= alpha(i)+lambda*step <= boxMax(i) and boxMin(j) <= alpha(j)-lambda*step <= boxMax(j) the update is performed in a numerically stable way and the internal data structures are also updated.
Reimplemented from shark::SvmProblem< Problem >.
Definition at line 651 of file SvmProblems.h.
References shark::blas::max(), shark::blas::min(), SIZE_CHECK, 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 620 of file SvmProblems.h.
|
inlinevirtual |
adapts the linear part of the problem and updates the internal data structures accordingly.
Reimplemented from shark::SvmProblem< Problem >.
Definition at line 637 of file SvmProblems.h.
|
inline |
Definition at line 613 of file SvmProblems.h.
|
inline |
Definition at line 563 of file SvmProblems.h.
|
inline |
Unshrink the problem.
Definition at line 586 of file SvmProblems.h.