mlpack
2.0.1
|
Public Types | |
typedef neighbor::NeighborSearchTraversalInfo< TreeType > | TraversalInfoType |
Public Member Functions | |
DTBRules (const arma::mat &dataSet, UnionFind &connections, arma::vec &neighborsDistances, arma::Col< size_t > &neighborsInComponent, arma::Col< size_t > &neighborsOutComponent, MetricType &metric) | |
double | BaseCase (const size_t queryIndex, const size_t referenceIndex) |
size_t | BaseCases () const |
Get the number of base cases performed. More... | |
size_t & | BaseCases () |
Modify the number of base cases performed. More... | |
double | Rescore (const size_t queryIndex, TreeType &referenceNode, const double oldScore) |
Re-evaluate the score for recursion order. More... | |
double | Rescore (TreeType &queryNode, TreeType &referenceNode, const double oldScore) const |
Re-evaluate the score for recursion order. More... | |
double | Score (const size_t queryIndex, TreeType &referenceNode) |
Get the score for recursion order. More... | |
double | Score (const size_t queryIndex, TreeType &referenceNode, const double baseCaseResult) |
Get the score for recursion order, passing the base case result (in the situation where it may be needed to calculate the recursion order). More... | |
double | Score (TreeType &queryNode, TreeType &referenceNode) |
Get the score for recursion order. More... | |
double | Score (TreeType &queryNode, TreeType &referenceNode, const double baseCaseResult) |
Get the score for recursion order, passing the base case result (in the situation where it may be needed to calculate the recursion order). More... | |
size_t | Scores () const |
Get the number of node combinations that have been scored. More... | |
size_t & | Scores () |
Modify the number of node combinations that have been scored. More... | |
const TraversalInfoType & | TraversalInfo () const |
TraversalInfoType & | TraversalInfo () |
Private Member Functions | |
double | CalculateBound (TreeType &queryNode) const |
Update the bound for the given query node. More... | |
Private Attributes | |
size_t | baseCases |
The number of base cases calculated. More... | |
UnionFind & | connections |
Stores the tree structure so far. More... | |
const arma::mat & | dataSet |
The data points. More... | |
MetricType & | metric |
The instantiated metric. More... | |
arma::vec & | neighborsDistances |
The distance to the candidate nearest neighbor for each component. More... | |
arma::Col< size_t > & | neighborsInComponent |
The index of the point in the component that is an endpoint of the candidate edge. More... | |
arma::Col< size_t > & | neighborsOutComponent |
The index of the point outside of the component that is an endpoint of the candidate edge. More... | |
size_t | scores |
The number of node combinations that have been scored. More... | |
TraversalInfoType | traversalInfo |
Definition at line 25 of file dtb_rules.hpp.
typedef neighbor::NeighborSearchTraversalInfo<TreeType> mlpack::emst::DTBRules< MetricType, TreeType >::TraversalInfoType |
Definition at line 115 of file dtb_rules.hpp.
mlpack::emst::DTBRules< MetricType, TreeType >::DTBRules | ( | const arma::mat & | dataSet, |
UnionFind & | connections, | ||
arma::vec & | neighborsDistances, | ||
arma::Col< size_t > & | neighborsInComponent, | ||
arma::Col< size_t > & | neighborsOutComponent, | ||
MetricType & | metric | ||
) |
double mlpack::emst::DTBRules< MetricType, TreeType >::BaseCase | ( | const size_t | queryIndex, |
const size_t | referenceIndex | ||
) |
|
inline |
Get the number of base cases performed.
Definition at line 121 of file dtb_rules.hpp.
References mlpack::emst::DTBRules< MetricType, TreeType >::baseCases.
|
inline |
Modify the number of base cases performed.
Definition at line 123 of file dtb_rules.hpp.
References mlpack::emst::DTBRules< MetricType, TreeType >::baseCases.
|
inlineprivate |
Update the bound for the given query node.
double mlpack::emst::DTBRules< MetricType, TreeType >::Rescore | ( | const size_t | queryIndex, |
TreeType & | referenceNode, | ||
const double | oldScore | ||
) |
Re-evaluate 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). 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.
double mlpack::emst::DTBRules< MetricType, TreeType >::Rescore | ( | TreeType & | queryNode, |
TreeType & | referenceNode, | ||
const double | oldScore | ||
) | const |
Re-evaluate 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). 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.
queryNode | Candidate query node to recurse into. |
referenceNode | Candidate reference node to recurse into. |
oldScore | Old score produced by Socre() (or Rescore()). |
double mlpack::emst::DTBRules< MetricType, TreeType >::Score | ( | const size_t | queryIndex, |
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).
queryIndex | Index of query point. |
referenceNode | Candidate node to be recursed into. |
double mlpack::emst::DTBRules< MetricType, TreeType >::Score | ( | const size_t | queryIndex, |
TreeType & | referenceNode, | ||
const double | baseCaseResult | ||
) |
Get the score for recursion order, passing the base case result (in the situation where it may be needed to calculate the 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).
queryIndex | Index of query point. |
referenceNode | Candidate node to be recursed into. |
baseCaseResult | Result of BaseCase(queryIndex, referenceNode). |
double mlpack::emst::DTBRules< MetricType, TreeType >::Score | ( | TreeType & | queryNode, |
TreeType & | referenceNode | ||
) |
Get the score for recursion order.
A low score indicates priority for recursionm while DBL_MAX indicates that the node should not be recursed into at all (it should be pruned).
queryNode | Candidate query node to recurse into. |
referenceNode | Candidate reference node to recurse into. |
double mlpack::emst::DTBRules< MetricType, TreeType >::Score | ( | TreeType & | queryNode, |
TreeType & | referenceNode, | ||
const double | baseCaseResult | ||
) |
Get the score for recursion order, passing the base case result (in the situation where it may be needed to calculate the 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).
queryNode | Candidate query node to recurse into. |
referenceNode | Candidate reference node to recurse into. |
baseCaseResult | Result of BaseCase(queryIndex, referenceNode). |
|
inline |
Get the number of node combinations that have been scored.
Definition at line 126 of file dtb_rules.hpp.
References mlpack::emst::DTBRules< MetricType, TreeType >::scores.
|
inline |
Modify the number of node combinations that have been scored.
Definition at line 128 of file dtb_rules.hpp.
References mlpack::emst::DTBRules< MetricType, TreeType >::scores.
|
inline |
Definition at line 117 of file dtb_rules.hpp.
References mlpack::emst::DTBRules< MetricType, TreeType >::traversalInfo.
|
inline |
Definition at line 118 of file dtb_rules.hpp.
References mlpack::emst::DTBRules< MetricType, TreeType >::traversalInfo.
|
private |
The number of base cases calculated.
Definition at line 159 of file dtb_rules.hpp.
Referenced by mlpack::emst::DTBRules< MetricType, TreeType >::BaseCases().
|
private |
Stores the tree structure so far.
Definition at line 135 of file dtb_rules.hpp.
|
private |
The data points.
Definition at line 132 of file dtb_rules.hpp.
|
private |
The instantiated metric.
Definition at line 149 of file dtb_rules.hpp.
|
private |
The distance to the candidate nearest neighbor for each component.
Definition at line 138 of file dtb_rules.hpp.
|
private |
The index of the point in the component that is an endpoint of the candidate edge.
Definition at line 142 of file dtb_rules.hpp.
|
private |
The index of the point outside of the component that is an endpoint of the candidate edge.
Definition at line 146 of file dtb_rules.hpp.
|
private |
The number of node combinations that have been scored.
Definition at line 161 of file dtb_rules.hpp.
Referenced by mlpack::emst::DTBRules< MetricType, TreeType >::Scores().
|
private |
Definition at line 156 of file dtb_rules.hpp.
Referenced by mlpack::emst::DTBRules< MetricType, TreeType >::TraversalInfo().