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 = 0, SMALLEST = 1 }
 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 (RemoveStrategyFlavor 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 63 of file RemoveBudgetMaintenanceStrategy.h.

Member Enumeration Documentation

◆ RemoveStrategyFlavor

the flavors of the remove strategy

Enumerator
RANDOM 
SMALLEST 

Definition at line 72 of file RemoveBudgetMaintenanceStrategy.h.

Constructor & Destructor Documentation

◆ RemoveBudgetMaintenanceStrategy()

constructor.

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

Definition at line 77 of file RemoveBudgetMaintenanceStrategy.h.

References SHARK_RUNTIME_CHECK.

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 >::basis(), shark::Data< Type >::element(), and shark::AbstractBudgetMaintenanceStrategy< InputType >::findSmallestVector().

◆ name()

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

class name

Definition at line 134 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 139 of file RemoveBudgetMaintenanceStrategy.h.


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