shark::RemoveBudgetMaintenanceStrategy< InputType > Class Template Reference

Budget maintenance strategy that removes a vector. More...

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

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

Public Types

enum  RemoveStrategyFlavor { RANDOM, SMALLEST }
 the flavors of the remove strategy More...
 
- Public Types inherited from shark::AbstractBudgetMaintenanceStrategy< InputType >
typedef KernelExpansion< InputTypeModelType
 
typedef LabeledData< InputType, unsigned int > DataType
 
typedef DataType::element_type ElementType
 

Public Member Functions

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

Protected Attributes

size_t m_flavor
 flavor for removing a vector More...
 

Additional Inherited Members

- 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::RemoveBudgetMaintenanceStrategy< InputType >

Budget maintenance strategy that removes a vector.

This is an budget strategy that simply removes one of the budget vectors. Depending on the flavor, this can be e.g. a random one, the smallest one (w.r.t. to 2-norm of the alphas)

Definition at line 64 of file RemoveBudgetMaintenanceStrategy.h.

Member Enumeration Documentation

§ RemoveStrategyFlavor

the flavors of the remove strategy

Enumerator
RANDOM 
SMALLEST 

Definition at line 73 of file RemoveBudgetMaintenanceStrategy.h.

Constructor & Destructor Documentation

§ RemoveBudgetMaintenanceStrategy()

template<class InputType >
shark::RemoveBudgetMaintenanceStrategy< InputType >::RemoveBudgetMaintenanceStrategy ( size_t  flavor = SMALLEST)
inline

constructor.

Parameters
[in]flavorenum that decides on the method a vector is removed.

Definition at line 78 of file RemoveBudgetMaintenanceStrategy.h.

Member Function Documentation

§ addToModel()

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

add a vector to the model. this will add the given vector to the model and remove another one depending on the flavor.

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

Implements shark::AbstractBudgetMaintenanceStrategy< InputType >.

Definition at line 91 of file RemoveBudgetMaintenanceStrategy.h.

References shark::KernelExpansion< InputType >::alpha(), shark::KernelExpansion< InputType >::basis(), shark::discrete(), shark::Data< Type >::element(), shark::AbstractBudgetMaintenanceStrategy< InputType >::findSmallestVector(), shark::RemoveBudgetMaintenanceStrategy< InputType >::m_flavor, shark::Data< Type >::numberOfElements(), shark::RemoveBudgetMaintenanceStrategy< InputType >::RANDOM, shark::blas::row(), and SHARKEXCEPTION.

§ name()

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

class name

Definition at line 137 of file RemoveBudgetMaintenanceStrategy.h.

Member Data Documentation

§ m_flavor

template<class InputType >
size_t shark::RemoveBudgetMaintenanceStrategy< InputType >::m_flavor
protected

flavor for removing a vector

Definition at line 142 of file RemoveBudgetMaintenanceStrategy.h.

Referenced by shark::RemoveBudgetMaintenanceStrategy< InputType >::addToModel().


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