mlpack  master
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
mlpack::neighbor::TrainVisitor< SortPolicy > Class Template Reference

TrainVisitor sets the reference set to a new reference set on the given NSType. More...

Inheritance diagram for mlpack::neighbor::TrainVisitor< SortPolicy >:
Inheritance graph
[legend]

Public Types

template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
using NSTypeT = NSType< SortPolicy, TreeType >
 Alias template necessary for visual c++ compiler. More...
 

Public Member Functions

 TrainVisitor (arma::mat &&referenceSet, const size_t leafSize, const double tau, const double rho)
 Construct the TrainVisitor object with the given reference set, leafSize for BinarySpaceTrees, and tau and rho for spill trees. More...
 
template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
void operator() (NSTypeT< TreeType > *ns) const
 Default Train on the given NSType instance. More...
 
void operator() (NSTypeT< tree::KDTree > *ns) const
 Train on the given NSType specialized for KDTrees. More...
 
void operator() (NSTypeT< tree::BallTree > *ns) const
 Train on the given NSType specialized for BallTrees. More...
 
void operator() (SpillKNN *ns) const
 Train specialized for SPTrees. More...
 
void operator() (NSTypeT< tree::Octree > *ns) const
 Train specialized for octrees. More...
 

Private Member Functions

template<typename NSType >
void TrainLeaf (NSType *ns) const
 Train on the given NSType considering the leafSize. More...
 

Private Attributes

size_t leafSize
 The leaf size, used only by BinarySpaceTree. More...
 
arma::mat && referenceSet
 The reference set to use for training. More...
 
const double rho
 Balance threshold (for spill trees). More...
 
const double tau
 Overlapping size (for spill trees). More...
 

Detailed Description

template<typename SortPolicy>
class mlpack::neighbor::TrainVisitor< SortPolicy >

TrainVisitor sets the reference set to a new reference set on the given NSType.

We use template specialization to differentiate those tree types that accept leafSize as a parameter. In these cases, a reference tree with proper leafSize is built from the referenceSet.

Definition at line 35 of file neighbor_search.hpp.

Member Typedef Documentation

template<typename SortPolicy >
template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
using mlpack::neighbor::TrainVisitor< SortPolicy >::NSTypeT = NSType<SortPolicy, TreeType>

Alias template necessary for visual c++ compiler.

Definition at line 183 of file ns_model.hpp.

Constructor & Destructor Documentation

template<typename SortPolicy >
mlpack::neighbor::TrainVisitor< SortPolicy >::TrainVisitor ( arma::mat &&  referenceSet,
const size_t  leafSize,
const double  tau,
const double  rho 
)

Construct the TrainVisitor object with the given reference set, leafSize for BinarySpaceTrees, and tau and rho for spill trees.

Member Function Documentation

template<typename SortPolicy >
template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
void mlpack::neighbor::TrainVisitor< SortPolicy >::operator() ( NSTypeT< TreeType > *  ns) const

Default Train on the given NSType instance.

template<typename SortPolicy >
void mlpack::neighbor::TrainVisitor< SortPolicy >::operator() ( NSTypeT< tree::KDTree > *  ns) const

Train on the given NSType specialized for KDTrees.

template<typename SortPolicy >
void mlpack::neighbor::TrainVisitor< SortPolicy >::operator() ( NSTypeT< tree::BallTree > *  ns) const

Train on the given NSType specialized for BallTrees.

template<typename SortPolicy >
void mlpack::neighbor::TrainVisitor< SortPolicy >::operator() ( SpillKNN ns) const

Train specialized for SPTrees.

template<typename SortPolicy >
void mlpack::neighbor::TrainVisitor< SortPolicy >::operator() ( NSTypeT< tree::Octree > *  ns) const

Train specialized for octrees.

template<typename SortPolicy >
template<typename NSType >
void mlpack::neighbor::TrainVisitor< SortPolicy >::TrainLeaf ( NSType ns) const
private

Train on the given NSType considering the leafSize.

Member Data Documentation

template<typename SortPolicy >
size_t mlpack::neighbor::TrainVisitor< SortPolicy >::leafSize
private

The leaf size, used only by BinarySpaceTree.

Definition at line 168 of file ns_model.hpp.

template<typename SortPolicy >
arma::mat&& mlpack::neighbor::TrainVisitor< SortPolicy >::referenceSet
private

The reference set to use for training.

Definition at line 166 of file ns_model.hpp.

template<typename SortPolicy >
const double mlpack::neighbor::TrainVisitor< SortPolicy >::rho
private

Balance threshold (for spill trees).

Definition at line 172 of file ns_model.hpp.

template<typename SortPolicy >
const double mlpack::neighbor::TrainVisitor< SortPolicy >::tau
private

Overlapping size (for spill trees).

Definition at line 170 of file ns_model.hpp.


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