SYNOPSIS

Public Types

typedef

neighbor::NeighborSearchTraversalInfo

< TreeType > TraversalInfoType"

Public Member Functions

FastMKSRules (const arma::mat &referenceSet, const arma::mat &querySet, arma::Mat< size_t > &indices, arma::mat &products, KernelType &kernel)

double BaseCase (const size_t queryIndex, const size_t referenceIndex)

Compute the base case (kernel value) between two points. size_t BaseCases () const

Get the number of times BaseCase() was called. size_t & BaseCases ()

Modify the number of times BaseCase() was called. double Rescore (const size_t queryIndex, TreeType &referenceNode, const double oldScore) const

Re-evaluate the score for recursion order. double Rescore (TreeType &queryNode, TreeType &referenceNode, const double oldScore) const

Re-evaluate the score for recursion order. double Score (const size_t queryIndex, TreeType &referenceNode)

Get the score for recursion order. double Score (TreeType &queryNode, TreeType &referenceNode)

Get the score for recursion order. size_t Scores () const

Get the number of times Score() was called. size_t & Scores ()

Modify the number of times Score() was called. const TraversalInfoType & TraversalInfo () const

TraversalInfoType & TraversalInfo ()

Private Member Functions

double CalculateBound (TreeType &queryNode) const

Calculate the bound for a given query node. void InsertNeighbor (const size_t queryIndex, const size_t pos, const size_t neighbor, const double distance)

Utility function to insert neighbor into list of results.

Private Attributes

size_t baseCases

For benchmarking. arma::Mat< size_t > & indices

The indices of the maximum kernel results. KernelType & kernel

The instantiated kernel. double lastKernel

The last kernel evaluation resulting from BaseCase(). size_t lastQueryIndex

The last query index BaseCase() was called with. size_t lastReferenceIndex

The last reference index BaseCase() was called with. arma::mat & products

The maximum kernels. arma::vec queryKernels

Cached query set self-kernels (|| q || for each q). const arma::mat & querySet

The query dataset. arma::vec referenceKernels

Cached reference set self-kernels (|| r || for each r). const arma::mat & referenceSet

The reference dataset. size_t scores

For benchmarking. TraversalInfoType traversalInfo

Detailed Description

template<typename KernelType, typename TreeType>class mlpack::fastmks::FastMKSRules< KernelType, TreeType >

The base case and pruning rules for FastMKS (fast max-kernel search).

Definition at line 37 of file fastmks_rules.hpp.

Member Typedef Documentation

template<typename KernelType , typename TreeType > typedef \fBneighbor::NeighborSearchTraversalInfo\fP<TreeType> \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::\fBTraversalInfoType\fP

Definition at line 109 of file fastmks_rules.hpp.

Constructor & Destructor Documentation

template<typename KernelType , typename TreeType > \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::\fBFastMKSRules\fP (const arma::mat &referenceSet, const arma::mat &querySet, arma::Mat< size_t > &indices, arma::mat &products, KernelType &kernel)

Member Function Documentation

template<typename KernelType , typename TreeType > double \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::BaseCase (const size_tqueryIndex, const size_treferenceIndex)

Compute the base case (kernel value) between two points.

template<typename KernelType , typename TreeType > size_t \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::BaseCases () const\fC [inline]\fP

Get the number of times BaseCase() was called.

Definition at line 100 of file fastmks_rules.hpp.

References mlpack::fastmks::FastMKSRules< KernelType, TreeType >::baseCases.

template<typename KernelType , typename TreeType > size_t& \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::BaseCases ()\fC [inline]\fP

Modify the number of times BaseCase() was called.

Definition at line 102 of file fastmks_rules.hpp.

References mlpack::fastmks::FastMKSRules< KernelType, TreeType >::baseCases.

template<typename KernelType , typename TreeType > double \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::CalculateBound (TreeType &queryNode) const\fC [private]\fP

Calculate the bound for a given query node.

template<typename KernelType , typename TreeType > void \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::InsertNeighbor (const size_tqueryIndex, const size_tpos, const size_tneighbor, const doubledistance)\fC [private]\fP

Utility function to insert neighbor into list of results.

template<typename KernelType , typename TreeType > double \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::Rescore (const size_tqueryIndex, TreeType &referenceNode, const doubleoldScore) const

Re-evaluate the score for recursion order. A low score indicates priority for recursion, while DBL_MAX indicates that a node should not be recursed into at all (it should be pruned). This is used when the score has already been calculated, but another recursion may have modified the bounds for pruning. So the old score is checked against the new pruning bound.

Parameters:

queryIndex Index of query point.

referenceNode Candidate node to be recursed into.

oldScore Old score produced by Score() (or Rescore()).

template<typename KernelType , typename TreeType > double \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::Rescore (TreeType &queryNode, TreeType &referenceNode, const doubleoldScore) const

Re-evaluate the score for recursion order. A low score indicates priority for recursion, while DBL_MAX indicates that a node should not be recursed into at all (it should be pruned). This is used when the score has already been calculated, but another recursion may have modified the bounds for pruning. So the old score is checked against the new pruning bound.

Parameters:

queryNode Candidate query node to be recursed into.

referenceNode Candidate reference node to be recursed into.

oldScore Old score produced by Score() (or Rescore()).

template<typename KernelType , typename TreeType > double \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::Score (const size_tqueryIndex, TreeType &referenceNode)

Get the score for recursion order. A low score indicates priority for recursion, while DBL_MAX indicates that the node should not be recursed into at all (it should be pruned).

Parameters:

queryIndex Index of query point.

referenceNode Candidate to be recursed into.

template<typename KernelType , typename TreeType > double \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::Score (TreeType &queryNode, TreeType &referenceNode)

Get the score for recursion order. A low score indicates priority for recursion, while DBL_MAX indicates that the node should not be recursed into at all (it should be pruned).

Parameters:

queryNode Candidate query node to be recursed into.

referenceNode Candidate reference node to be recursed into.

template<typename KernelType , typename TreeType > size_t \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::Scores () const\fC [inline]\fP

Get the number of times Score() was called.

Definition at line 105 of file fastmks_rules.hpp.

References mlpack::fastmks::FastMKSRules< KernelType, TreeType >::scores.

template<typename KernelType , typename TreeType > size_t& \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::Scores ()\fC [inline]\fP

Modify the number of times Score() was called.

Definition at line 107 of file fastmks_rules.hpp.

References mlpack::fastmks::FastMKSRules< KernelType, TreeType >::scores.

template<typename KernelType , typename TreeType > const \fBTraversalInfoType\fP& \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::\fBTraversalInfo\fP () const\fC [inline]\fP

Definition at line 111 of file fastmks_rules.hpp.

References mlpack::fastmks::FastMKSRules< KernelType, TreeType >::traversalInfo.

template<typename KernelType , typename TreeType > \fBTraversalInfoType\fP& \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::\fBTraversalInfo\fP ()\fC [inline]\fP

Definition at line 112 of file fastmks_rules.hpp.

References mlpack::fastmks::FastMKSRules< KernelType, TreeType >::traversalInfo.

Member Data Documentation

template<typename KernelType , typename TreeType > size_t \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::baseCases\fC [private]\fP

For benchmarking.

Definition at line 150 of file fastmks_rules.hpp.

Referenced by mlpack::fastmks::FastMKSRules< KernelType, TreeType >::BaseCases().

template<typename KernelType , typename TreeType > arma::Mat<size_t>& \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::indices\fC [private]\fP

The indices of the maximum kernel results.

Definition at line 121 of file fastmks_rules.hpp.

template<typename KernelType , typename TreeType > KernelType& \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::kernel\fC [private]\fP

The instantiated kernel.

Definition at line 131 of file fastmks_rules.hpp.

template<typename KernelType , typename TreeType > double \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::lastKernel\fC [private]\fP

The last kernel evaluation resulting from BaseCase().

Definition at line 138 of file fastmks_rules.hpp.

template<typename KernelType , typename TreeType > size_t \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::lastQueryIndex\fC [private]\fP

The last query index BaseCase() was called with.

Definition at line 134 of file fastmks_rules.hpp.

template<typename KernelType , typename TreeType > size_t \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::lastReferenceIndex\fC [private]\fP

The last reference index BaseCase() was called with.

Definition at line 136 of file fastmks_rules.hpp.

template<typename KernelType , typename TreeType > arma::mat& \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::products\fC [private]\fP

The maximum kernels.

Definition at line 123 of file fastmks_rules.hpp.

template<typename KernelType , typename TreeType > arma::vec \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::queryKernels\fC [private]\fP

Cached query set self-kernels (|| q || for each q).

Definition at line 126 of file fastmks_rules.hpp.

template<typename KernelType , typename TreeType > const arma::mat& \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::querySet\fC [private]\fP

The query dataset.

Definition at line 118 of file fastmks_rules.hpp.

template<typename KernelType , typename TreeType > arma::vec \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::referenceKernels\fC [private]\fP

Cached reference set self-kernels (|| r || for each r).

Definition at line 128 of file fastmks_rules.hpp.

template<typename KernelType , typename TreeType > const arma::mat& \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::referenceSet\fC [private]\fP

The reference dataset.

Definition at line 116 of file fastmks_rules.hpp.

template<typename KernelType , typename TreeType > size_t \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::scores\fC [private]\fP

For benchmarking.

Definition at line 152 of file fastmks_rules.hpp.

Referenced by mlpack::fastmks::FastMKSRules< KernelType, TreeType >::Scores().

template<typename KernelType , typename TreeType > \fBTraversalInfoType\fP \fBmlpack::fastmks::FastMKSRules\fP< KernelType, TreeType >::traversalInfo\fC [private]\fP

Definition at line 154 of file fastmks_rules.hpp.

Referenced by mlpack::fastmks::FastMKSRules< KernelType, TreeType >::TraversalInfo().

Author

Generated automatically by Doxygen for MLPACK from the source code.