curfil  ..
 All Classes Functions Variables Typedefs Friends Groups Pages
Public Member Functions | List of all members
curfil::ImageFeatureEvaluation Class Reference

Helper class for the four phases in the cost-intensive best-split evaluation during random forest training. More...

#include <random_tree_image.h>

Public Member Functions

 ImageFeatureEvaluation (const size_t treeId, const TrainingConfiguration &configuration)
 helper object for feature evaluation for the given tree and training configuration
std::vector< SplitFunction
< PixelInstance,
ImageFeatureFunction > > 
evaluateBestSplits (RandomSource &randomSource, const std::vector< std::pair< boost::shared_ptr< RandomTree< PixelInstance, ImageFeatureFunction > >, std::vector< const PixelInstance * > > > &samplesPerNode)
std::vector< std::vector
< const PixelInstance * > > 
prepare (const std::vector< const PixelInstance * > &samples, RandomTree< PixelInstance, ImageFeatureFunction > &node, cuv::host_memory_space)
std::vector< std::vector
< const PixelInstance * > > 
prepare (const std::vector< const PixelInstance * > &samples, RandomTree< PixelInstance, ImageFeatureFunction > &node, cuv::dev_memory_space, bool keepMutexLocked=true)
ImageFeaturesAndThresholds
< cuv::host_memory_space
generateRandomFeatures (const std::vector< const PixelInstance * > &batches, int seed, const bool sort, cuv::host_memory_space)
ImageFeaturesAndThresholds
< cuv::dev_memory_space
generateRandomFeatures (const std::vector< const PixelInstance * > &batches, int seed, const bool sort, cuv::dev_memory_space)
template<class memory_space >
void sortFeatures (ImageFeaturesAndThresholds< memory_space > &featuresAndThresholds, const cuv::ndarray< int, memory_space > &keysIndices) const
 sort features by the given keys
template<class memory_space >
cuv::ndarray< WeightType,
memory_space > 
calculateFeatureResponsesAndHistograms (RandomTree< PixelInstance, ImageFeatureFunction > &node, const std::vector< std::vector< const PixelInstance * > > &batches, const ImageFeaturesAndThresholds< memory_space > &featuresAndThresholds, cuv::ndarray< FeatureResponseType, cuv::host_memory_space > *featureResponsesHost=0)
template<class memory_space >
cuv::ndarray< ScoreType,
cuv::host_memory_space
calculateScores (const cuv::ndarray< WeightType, memory_space > &counters, const ImageFeaturesAndThresholds< memory_space > &featuresAndThresholds, const cuv::ndarray< WeightType, memory_space > &histogram)

Detailed Description

Helper class for the four phases in the cost-intensive best-split evaluation during random forest training.

See the Master’s thesis "Accelerating Random Forests on CPUs and GPUs for Object-Class Image Segmentation" for more details on this implementation.

Clients are not intended to use this class directly.

Definition at line 961 of file random_tree_image.h.

Member Function Documentation

template<class memory_space >
cuv::ndarray<WeightType, memory_space> curfil::ImageFeatureEvaluation::calculateFeatureResponsesAndHistograms ( RandomTree< PixelInstance, ImageFeatureFunction > &  node,
const std::vector< std::vector< const PixelInstance * > > &  batches,
const ImageFeaturesAndThresholds< memory_space > &  featuresAndThresholds,
cuv::ndarray< FeatureResponseType, cuv::host_memory_space > *  featureResponsesHost = 0 
)
Returns
histogram counters after calculating feature responses
template<class memory_space >
cuv::ndarray<ScoreType, cuv::host_memory_space> curfil::ImageFeatureEvaluation::calculateScores ( const cuv::ndarray< WeightType, memory_space > &  counters,
const ImageFeaturesAndThresholds< memory_space > &  featuresAndThresholds,
const cuv::ndarray< WeightType, memory_space > &  histogram 
)
Returns
normalized cores after calculating the information gain that results from splitting
std::vector<SplitFunction<PixelInstance, ImageFeatureFunction> > curfil::ImageFeatureEvaluation::evaluateBestSplits ( RandomSource randomSource,
const std::vector< std::pair< boost::shared_ptr< RandomTree< PixelInstance, ImageFeatureFunction > >, std::vector< const PixelInstance * > > > &  samplesPerNode 
)
Returns
best features and thresholds to split after evaluating splits
ImageFeaturesAndThresholds<cuv::host_memory_space> curfil::ImageFeatureEvaluation::generateRandomFeatures ( const std::vector< const PixelInstance * > &  batches,
int  seed,
const bool  sort,
cuv::host_memory_space   
)
Returns
random features and thresholds
ImageFeaturesAndThresholds<cuv::dev_memory_space> curfil::ImageFeatureEvaluation::generateRandomFeatures ( const std::vector< const PixelInstance * > &  batches,
int  seed,
const bool  sort,
cuv::dev_memory_space   
)
Returns
random features and thresholds
std::vector<std::vector<const PixelInstance*> > curfil::ImageFeatureEvaluation::prepare ( const std::vector< const PixelInstance * > &  samples,
RandomTree< PixelInstance, ImageFeatureFunction > &  node,
cuv::host_memory_space   
)
Returns
a batch that contains the given samples
std::vector<std::vector<const PixelInstance*> > curfil::ImageFeatureEvaluation::prepare ( const std::vector< const PixelInstance * > &  samples,
RandomTree< PixelInstance, ImageFeatureFunction > &  node,
cuv::dev_memory_space  ,
bool  keepMutexLocked = true 
)
Returns
a batch that contains the given samples

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