SG++-Doxygen-Documentation
|
A refinement indicator for support vector classification using sparse grids (according to König BA). More...
#include <ForwardSelectorRefinementIndicator.hpp>
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 | |
DataVector & | alphas |
double | beta |
bool | performUpdate |
size_t | refinementsNum |
DataVector | rv1 |
DataVector | rv2 |
DataMatrix & | svs |
double | threshold |
DataVector & | w1 |
DataVector & | w2 |
A refinement indicator for support vector classification using sparse grids (according to König BA).
typedef std::pair<size_t, double> sgpp::base::ForwardSelectorRefinementIndicator::value_type |
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.
grid | The sparse grid |
svs | Contains all currently stored support vectors |
alphas | The weights corresponding to the support vectors |
w1 | The normal vector |
w2 | The normal vector computted with abs weights |
beta | Specifies relevance of grid points (default: equal relevance for all grid points) |
threshold | The refinement threshold; Only grid points with indicator values greater than this threshold will be refined |
refinementsNum | The max amount of grid points to be refined |
performUpdate | Specifies 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().
|
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.
Reimplemented from sgpp::base::RefinementFunctor.
References refinementsNum.
|
overridevirtual |
Returns the threshold for refinement.
Only the grid points with absolute value of refinement criterion greater than this threshold will be refined.
Implements sgpp::base::RefinementFunctor.
References threshold.
Referenced by sgpp::base::ForwardSelectorRefinement::getIndicator().
|
overridevirtual |
This should be returning a refinement indication value for every grid point.
The grid point with the highest value will be refined first.
storage | Reference to the grids storage object |
seq | Sequence number in the coefficients array |
Implements sgpp::base::RefinementFunctor.
References beta, sgpp::base::DataVector::get(), sgpp::combigrid::pow(), rv2, w1, and w2.
|
virtual |
This should be returning a refinement indicator for the specified grid point The point with the highest value will be refined first.
point | Grid point for which to calculate an indicator value |
double sgpp::base::ForwardSelectorRefinementIndicator::runOperator | ( | GridStorage & | storage, |
size_t | seq | ||
) |
References sgpp::base::HashGridStorage::getPoint().
|
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
Implements sgpp::base::RefinementFunctor.
void sgpp::base::ForwardSelectorRefinementIndicator::update | ( | GridPoint & | point | ) |
Update normal vector of SVM.
For each new grid point the normal vector has to be extended by one component.
point | The new grid point |
References alphas, sgpp::base::DataVector::append(), chess::dim, sgpp::base::Basis< LT, IT >::eval(), sgpp::base::DataVector::get(), sgpp::base::DataMatrix::get(), sgpp::base::Grid::getBasis(), sgpp::base::HashGridPoint::getDimension(), sgpp::base::HashGridPoint::getIndex(), sgpp::base::HashGridPoint::getLevel(), sgpp::base::DataMatrix::getNrows(), level, performUpdate, svs, w1, and w2.
Referenced by python.uq.refinement.RefinementStrategy.Ranking::rank(), sgpp::base::ForwardSelectorRefinement::refineGridpointsCollection(), and python.learner.LearnedKnowledge.LearnedKnowledge::setMemento().
|
protected |
Referenced by update().
|
protected |
Referenced by operator()().
|
protected |
Referenced by update().
|
protected |
Referenced by getRefinementsNum().
|
protected |
Referenced by ForwardSelectorRefinementIndicator().
|
protected |
Referenced by ForwardSelectorRefinementIndicator(), and operator()().
|
protected |
Referenced by update().
|
protected |
Referenced by getRefinementThreshold().
|
protected |
Referenced by operator()(), and update().
|
protected |
Referenced by operator()(), and update().