shark::MergeBudgetMaintenanceStrategy< InputType > Class Template Reference

Budget maintenance strategy that merges two vectors. More...

#include <shark/Algorithms/Trainers/Budgeted/MergeBudgetMaintenanceStrategy.h>

+ Inheritance diagram for shark::MergeBudgetMaintenanceStrategy< InputType >:

Public Member Functions

 MergeBudgetMaintenanceStrategy ()
 constructor. More...
 
virtual void addToModel (ModelType &model, InputType &alpha, ElementType &supportVector)
 
std::string name () const
 class name More...
 
- Public Member Functions inherited from shark::AbstractBudgetMaintenanceStrategy< InputType >
 AbstractBudgetMaintenanceStrategy ()
 
virtual void addToModel (ModelType &model, InputType const &alpha, ElementType const &supportVector)=0
 
std::string name () const
 return the class name More...
 

Additional Inherited Members

- Public Types inherited from shark::AbstractBudgetMaintenanceStrategy< InputType >
typedef KernelExpansion< InputTypeModelType
 
typedef LabeledData< InputType, unsigned int > DataType
 
typedef DataType::element_type ElementType
 
- Static Public Member Functions inherited from shark::AbstractBudgetMaintenanceStrategy< InputType >
static void findSmallestVector (ModelType const &model, size_t &minIndex, double &minAlpha)
 

Detailed Description

template<class InputType>
class shark::MergeBudgetMaintenanceStrategy< InputType >

Budget maintenance strategy that merges two vectors.

This is an budget strategy that simply merges two budget vectors
in order to make space for a new one. This is done by first searching for the budget vector that has smallest

\[ ||\alpha||_2\]

coefficient– only then a second one is searched for, by inspecting the expected weight degradation after merging. The vector with smallest weight degradation is the vector one should merge with the first one. By this heuristic, the merging strategy has complexity

\[ \mathcal{O}(B) \]

. Compared with the projection strategy, merging should be faster, and stil obtains similar accuracy. Unluckily any kind of timing numbers are missing in the reference paper of Wang, Crammer and Vucetic.
Note that in general it is unclear how two data objects should be merged,
e.g. strings must be merged differently than vectors. Therefore it is necessary to create an specialization of this strategy for a given input type.

Definition at line 84 of file MergeBudgetMaintenanceStrategy.h.

Constructor & Destructor Documentation

§ MergeBudgetMaintenanceStrategy()

constructor.

Definition at line 93 of file MergeBudgetMaintenanceStrategy.h.

Member Function Documentation

§ addToModel()

template<class InputType>
virtual void shark::MergeBudgetMaintenanceStrategy< InputType >::addToModel ( ModelType model,
InputType alpha,
ElementType supportVector 
)
inlinevirtual

add to model. this is just a fake here, as it is unclear in general how to merge two objects, one needs to specialize this template.

Parameters
[in,out]modelthe model the strategy will work with
[in]alphaalphas for the new budget vector
[in]supportVectorthe vector to add to the model by applying the maintenance strategy

Definition at line 106 of file MergeBudgetMaintenanceStrategy.h.

References SHARKEXCEPTION.

§ name()

template<class InputType>
std::string shark::MergeBudgetMaintenanceStrategy< InputType >::name ( ) const
inline

class name

Definition at line 115 of file MergeBudgetMaintenanceStrategy.h.

Referenced by main().


The documentation for this class was generated from the following file: