Budget maintenance strategy that removes a vector. More...
#include <shark/Algorithms/Trainers/Budgeted/RemoveBudgetMaintenanceStrategy.h>
Public Types | |
enum | RemoveStrategyFlavor { RANDOM = 0, SMALLEST = 1 } |
the flavors of the remove strategy More... | |
Public Types inherited from shark::AbstractBudgetMaintenanceStrategy< InputType > | |
typedef KernelExpansion< InputType > | ModelType |
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) |
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.
enum shark::RemoveBudgetMaintenanceStrategy::RemoveStrategyFlavor |
the flavors of the remove strategy
Enumerator | |
---|---|
RANDOM | |
SMALLEST |
Definition at line 72 of file RemoveBudgetMaintenanceStrategy.h.
|
inline |
constructor.
[in] | flavor | enum that decides on the method a vector is removed. |
Definition at line 77 of file RemoveBudgetMaintenanceStrategy.h.
References SHARK_RUNTIME_CHECK.
|
inlinevirtual |
add a vector to the model. this will add the given vector to the model and remove another one depending on the flavor.
[in,out] | model | the model the strategy will work with |
[in] | alpha | alphas for the new budget vector |
[in] | supportVector | the 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().
|
inline |
class name
Definition at line 134 of file RemoveBudgetMaintenanceStrategy.h.
|
protected |
flavor for removing a vector
Definition at line 139 of file RemoveBudgetMaintenanceStrategy.h.