SG++-Doxygen-Documentation
sgpp::datadriven::MultipleClassRefinementFunctor Class Reference

Multiple class refinement is based on the zero-crossing based refinement. More...

#include <MultipleClassRefinementFunctor.hpp>

Inheritance diagram for sgpp::datadriven::MultipleClassRefinementFunctor:
sgpp::datadriven::ZeroCrossingRefinementFunctor sgpp::datadriven::MultiGridRefinementFunctor sgpp::base::RefinementFunctor

Public Member Functions

double getBorderPenalty ()
 Gets the factor, the borders are penalized with. More...
 
double getTopPercent ()
 Gets the range in which densities are considered to be close. More...
 
 MultipleClassRefinementFunctor (std::vector< base::Grid *> grids, std::vector< base::DataVector *> alphas, size_t refinements_num, size_t partCombined, double thresh)
 Constructor. More...
 
double operator() (base::GridStorage &storage, size_t seq) const override
 This should be returning a refinement value for every grid point. More...
 
void refine ()
 Organizes the refinement of the classes uses set parameter to execute the refinement step. More...
 
void setBorderPenalty (double newPenalty)
 Sets the factor, used to penalize the borders. More...
 
void setTopPercent (double newPercent)
 Sets the range in which densities are considered to be close. More...
 
- Public Member Functions inherited from sgpp::datadriven::ZeroCrossingRefinementFunctor
size_t getNumGrids () override
 Returns the number of grids the functor can / does refine. 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() (base::GridStorage &storage, size_t seq) const override
 This should be returning a refinement value for every grid point. More...
 
void preComputeEvaluations () override
 Precomputes grid evaluations for all grids. More...
 
void setGridIndex (size_t grid_index) override
 Sets the index (into the vector of grids) of the grid to be refined. More...
 
double start () const override
 Returns the lower bound of refinement criterion (e.g., alpha or error) (lower bound). More...
 
 ZeroCrossingRefinementFunctor (std::vector< base::Grid *> grids, std::vector< base::DataVector *> alphas, size_t refinements_num=1, bool level_penalize=false, bool pre_compute=false, double threshold=0.0)
 Constructor. More...
 
virtual ~ZeroCrossingRefinementFunctor ()
 
- Public Member Functions inherited from sgpp::datadriven::MultiGridRefinementFunctor
virtual ~MultiGridRefinementFunctor ()
 
- 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...
 

Additional Inherited Members

- Public Types inherited from sgpp::base::RefinementFunctor
typedef double value_type
 
- Protected Member Functions inherited from sgpp::datadriven::ZeroCrossingRefinementFunctor
void getChild (const base::HashGridPoint &gp, size_t d, bool left, base::HashGridPoint &child) const
 
std::vector< double > getEvalVector (size_t ind, size_t seq) const
 Gets the evaluations of all grids at the coords of seq. More...
 
void getParent (const base::HashGridPoint &gp, size_t d, base::HashGridPoint &par) const
 
void goDown (base::HashGridPoint &gp, base::HashGridPoint &down, size_t d, bool left) const
 Used for non-leaf grid points. More...
 
void goUp (base::HashGridPoint &gp, base::HashGridPoint &up, size_t d, bool left) const
 Used for leaf grid points. More...
 
bool hasChild (const base::HashGridPoint &gp, size_t d, bool left) const
 
bool isLeftChild (const base::HashGridPoint &gp, size_t d) const
 
int sgn (double d) const
 
- Protected Attributes inherited from sgpp::datadriven::ZeroCrossingRefinementFunctor
std::vector< base::DataVector * > alphas
 
size_t current_grid_index
 
std::vector< base::Grid * > grids
 
bool level_penalize
 
std::vector< std::map< std::string, double > > pre_comp_evals
 Stores grid evaluations at all grids (vector) at the union of grid point coordinates over all grids (hashed by string representation in the map) More...
 
bool pre_compute
 
size_t refinements_num
 
double threshold
 

Detailed Description

Multiple class refinement is based on the zero-crossing based refinement.

The zero-crossings are not determinate by pairwise comparing the sings of PDFS f_1 - f_2, but by comparing the dominating class at geometric neighbors, determined for each dimension separately.

Finer levels are penalized by 2^{-|l|}.

Constructor & Destructor Documentation

◆ MultipleClassRefinementFunctor()

sgpp::datadriven::MultipleClassRefinementFunctor::MultipleClassRefinementFunctor ( std::vector< base::Grid *>  grids,
std::vector< base::DataVector *>  alphas,
size_t  refinements_num,
size_t  partCombined,
double  thresh 
)

Constructor.

Parameters
gridsVector of grids. current_grid_index specifies the grid to be refined
alphasVector of surpluses related to the grids
refinements_numMaximum number of refinements done
partCombinedNumber of refinement done in the combined grid
threshThreshold for refinement scores

Member Function Documentation

◆ getBorderPenalty()

double sgpp::datadriven::MultipleClassRefinementFunctor::getBorderPenalty ( )

Gets the factor, the borders are penalized with.

Returns
The border penalty

◆ getTopPercent()

double sgpp::datadriven::MultipleClassRefinementFunctor::getTopPercent ( )

Gets the range in which densities are considered to be close.

Gives a percentage [0,1].

Returns
Range in which densities are considered close

◆ operator()()

◆ refine()

void sgpp::datadriven::MultipleClassRefinementFunctor::refine ( )

◆ setBorderPenalty()

void sgpp::datadriven::MultipleClassRefinementFunctor::setBorderPenalty ( double  newPenalty)

Sets the factor, used to penalize the borders.

The border score is multiplied with the factor before beeing added to the overall score.

Parameters
newPenaltyFactor to penalize the borders

References sgpp::base::Grid::getStorage(), and sgpp::base::HashGridIterator::set().

◆ setTopPercent()

void sgpp::datadriven::MultipleClassRefinementFunctor::setTopPercent ( double  newPercent)

Sets the range in which densities are considered to be close.

Set the percentage [0,1] the densities need to have, compared to the density of the dominating class.

Parameters
newPercentSet the new range

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