SG++-Doxygen-Documentation
sgpp::base::ForwardSelectorRefinementIndicator Class Reference

A refinement indicator for support vector classification using sparse grids (according to König BA). More...

#include <ForwardSelectorRefinementIndicator.hpp>

Inheritance diagram for sgpp::base::ForwardSelectorRefinementIndicator:
sgpp::base::RefinementFunctor

Public Types

typedef GridPoint counter_key_type
 
typedef std::pair< size_t, double > value_type
 
- Public Types inherited from sgpp::base::RefinementFunctor
typedef double value_type
 

Public Member Functions

 ForwardSelectorRefinementIndicator (Grid &grid, DataMatrix &svs, DataVector &alphas, DataVector &w1, DataVector &w2, double beta, double threshold=0.0, size_t refinementsNum=1, bool performUpdate=true)
 Constructor. More...
 
size_t getRefinementsNum () const override
 Returns the maximal number of points that should be refined. More...
 
double getRefinementThreshold () const override
 Returns the threshold for refinement. More...
 
double operator() (GridStorage &storage, size_t seq) const override
 This should be returning a refinement indication value for every grid point. More...
 
virtual double operator() (GridPoint &point) const
 This should be returning a refinement indicator for the specified grid point The point with the highest value will be refined first. More...
 
double runOperator (GridStorage &storage, size_t seq)
 
double start () const override
 Returns the lower bound of refinement criterion (e.g., alpha or error) (lower bound). More...
 
void update (GridPoint &point)
 Update normal vector of SVM. More...
 
- Public Member Functions inherited from sgpp::base::RefinementFunctor
virtual double getTotalRefinementValue (GridStorage &storage) const
 Returns the total sum of local (error) indicators used for refinement. More...
 
 RefinementFunctor ()
 Constructor. More...
 
virtual ~RefinementFunctor ()
 Destructor. More...
 

Protected Attributes

DataVectoralphas
 
double beta
 
bool performUpdate
 
size_t refinementsNum
 
DataVector rv1
 
DataVector rv2
 
DataMatrixsvs
 
double threshold
 
DataVectorw1
 
DataVectorw2
 

Detailed Description

A refinement indicator for support vector classification using sparse grids (according to König BA).

Member Typedef Documentation

◆ counter_key_type

◆ value_type

Constructor & Destructor Documentation

◆ ForwardSelectorRefinementIndicator()

sgpp::base::ForwardSelectorRefinementIndicator::ForwardSelectorRefinementIndicator ( Grid grid,
DataMatrix svs,
DataVector alphas,
DataVector w1,
DataVector w2,
double  beta,
double  threshold = 0.0,
size_t  refinementsNum = 1,
bool  performUpdate = true 
)

Constructor.

Parameters
gridThe sparse grid
svsContains all currently stored support vectors
alphasThe weights corresponding to the support vectors
w1The normal vector
w2The normal vector computted with abs weights
betaSpecifies relevance of grid points (default: equal relevance for all grid points)
thresholdThe refinement threshold; Only grid points with indicator values greater than this threshold will be refined
refinementsNumThe max amount of grid points to be refined
performUpdateSpecifies if normal vector should be updated after refinement

References sgpp::base::DataVector::add(), alpha, sgpp::op_factory::createOperationMultipleEval(), sgpp::base::DataVector::dotProduct(), sgpp::base::DataVector::get(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getRow(), sgpp::base::Grid::getSize(), python.statsfileInfo::i, rv1, rv2, and sgpp::base::DataMatrix::setRow().

Member Function Documentation

◆ getRefinementsNum()

size_t sgpp::base::ForwardSelectorRefinementIndicator::getRefinementsNum ( ) const
overridevirtual

Returns the maximal number of points that should be refined.

The maximal number of points to refine is set in the constructor of the implementing class.

Returns
number of points that should refined. Default value: 1.

Reimplemented from sgpp::base::RefinementFunctor.

References refinementsNum.

◆ getRefinementThreshold()

double sgpp::base::ForwardSelectorRefinementIndicator::getRefinementThreshold ( ) const
overridevirtual

Returns the threshold for refinement.

Only the grid points with absolute value of refinement criterion greater than this threshold will be refined.

Returns
threshold value for refinement. Default value: 0.

Implements sgpp::base::RefinementFunctor.

References threshold.

Referenced by sgpp::base::ForwardSelectorRefinement::getIndicator().

◆ operator()() [1/2]

double sgpp::base::ForwardSelectorRefinementIndicator::operator() ( GridStorage storage,
size_t  seq 
) const
overridevirtual

This should be returning a refinement indication value for every grid point.

The grid point with the highest value will be refined first.

Parameters
storageReference to the grids storage object
seqSequence number in the coefficients array
Returns
The refinement indicator value

Implements sgpp::base::RefinementFunctor.

References beta, sgpp::base::DataVector::get(), sgpp::combigrid::pow(), rv2, w1, and w2.

◆ operator()() [2/2]

double sgpp::base::ForwardSelectorRefinementIndicator::operator() ( GridPoint point) const
virtual

This should be returning a refinement indicator for the specified grid point The point with the highest value will be refined first.

Parameters
pointGrid point for which to calculate an indicator value
Returns
The indicator value

◆ runOperator()

double sgpp::base::ForwardSelectorRefinementIndicator::runOperator ( GridStorage storage,
size_t  seq 
)

◆ start()

double sgpp::base::ForwardSelectorRefinementIndicator::start ( ) const
overridevirtual

Returns the lower bound of refinement criterion (e.g., alpha or error) (lower bound).

The refinement value of grid points to be refined have to be larger than this value

Returns
lower bound

Implements sgpp::base::RefinementFunctor.

◆ update()

Member Data Documentation

◆ alphas

DataVector& sgpp::base::ForwardSelectorRefinementIndicator::alphas
protected

Referenced by update().

◆ beta

double sgpp::base::ForwardSelectorRefinementIndicator::beta
protected

Referenced by operator()().

◆ performUpdate

bool sgpp::base::ForwardSelectorRefinementIndicator::performUpdate
protected

Referenced by update().

◆ refinementsNum

size_t sgpp::base::ForwardSelectorRefinementIndicator::refinementsNum
protected

Referenced by getRefinementsNum().

◆ rv1

DataVector sgpp::base::ForwardSelectorRefinementIndicator::rv1
protected

◆ rv2

DataVector sgpp::base::ForwardSelectorRefinementIndicator::rv2
protected

◆ svs

DataMatrix& sgpp::base::ForwardSelectorRefinementIndicator::svs
protected

Referenced by update().

◆ threshold

double sgpp::base::ForwardSelectorRefinementIndicator::threshold
protected

Referenced by getRefinementThreshold().

◆ w1

DataVector& sgpp::base::ForwardSelectorRefinementIndicator::w1
protected

Referenced by operator()(), and update().

◆ w2

DataVector& sgpp::base::ForwardSelectorRefinementIndicator::w2
protected

Referenced by operator()(), and update().


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