[mlpack] 16/324: add a short and hopefully useful explanation of what different files are for, focusing on BSP trees.

Barak A. Pearlmutter barak+git at cs.nuim.ie
Sun Aug 17 08:21:51 UTC 2014


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit dbfe468400ab2c2b7c7a6a199dc7dcb12ff6009a
Author: andrewmw94 <andrewmw94 at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Thu May 22 18:41:17 2014 +0000

    add a short and hopefully useful explanation of what different files are for, focusing on BSP trees.
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@16543 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/core/tree/TREE_EXPLANATION.txt          | 90 ++++++++++++++++++++++
 .../tree/rectangle_tree/rectangle_tree_impl.hpp    |  5 +-
 2 files changed, 93 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/core/tree/TREE_EXPLANATION.txt b/src/mlpack/core/tree/TREE_EXPLANATION.txt
new file mode 100644
index 0000000..7b402b6
--- /dev/null
+++ b/src/mlpack/core/tree/TREE_EXPLANATION.txt
@@ -0,0 +1,90 @@
+An attempt to outline how the trees work.  At the top, we have a description of how the tree
+is set up in terms of functionality.  Then we state which files are responsible for each function.
+At the bottom, we list the files and explain what each of them does. 
+
+
+Since dynamic changes are not supported, there are two main activities on a Binary Space Tree:
+      Building. Which is always bulk loading.
+      Searching.
+
+The trees are designed to allow flexibility.  As such, the following classes are coded separately:
+      Bounds.  There is currently support for hyperrectangles and hyperspheres.
+      Metrics.  The tree supports LMetrics.
+      Splits.  The strategy for splitting the tree can be changed.
+      Query rules.  The methods for determining which points are selected in a search.
+      Tree traversal.  The trees support both single_tree and dual_tree traversal algorithms.
+
+There are also a few miscellanious items for tracking data about the tree and queries.
+
+Below is a more detailed description and the name of the file(s) with the applicable
+functionality.  All names are given relative to .../mlpack/src/mlpack/core/tree/ :
+      Bounds. 
+      	      Bounds are used to record the possible location so points in a node.  This is used
+	      to allow more aggressive pruning of the tree while searching.
+	      
+	      See files: ballbound.hpp, ballbound_impl.hpp, bounds.hpp, hrectbound.hpp,
+	      and hrectbound_impl.hpp
+      Metrics.
+	      Metrics are used to allow the user to specify different distance metrics.
+	      The trees currently support LMetrics.
+
+	      See files: ../metrics/ip_metric.hpp, ../metrics/ip_metric_impl.hpp,
+	      ../metrics/lmetric.hpp, ../metrics/lmetric_impl.hpp,
+	      ../metrics/mahalanobis_distance.hpp, ../metrics/mahalanobis_distance_impl.hpp
+      Splits.
+	      Splits are used to allow various algorithms for splitting nodes to be used
+	      when building trees.
+
+	      See files: binary_space_tree/mean_split.hpp, binary_space_tree/mean_split_impl.hpp
+      Query rules.
+      	      Queries can be either nearest neighbors or furthest neighbors, so we keep the code
+	      for each of these separate.
+
+	      See files: ../../methods/neighbor_search/neighbor_search_rules.hpp,
+	      and ../../methods/neighbor_search/neighbor_search_rules_impl.hpp.
+      Tree traversal.
+      	      Tree traversal methods are used to find the points in the tree that would be selected
+	      by the Query rules by pruning regions that don't need to be searched.
+
+	      See files: binary_space_tree/single_tree_traverser.hpp, 
+	      binary_space_tree/single_tree_traverser_impl.hpp, 
+	      binary_space_tree/dual_tree_traverser.hpp,
+	      and binary_space_tree/dual_tree_traverser_impl.hpp
+
+
+Below is a list of files and what they do:
+
+../../methods/neighbor_search/neighbor_search_rules.hpp
+../../methods/neighbor_search/neighbor_search_rules_impl.hpp
+	These handle the query rules, which allow us to have different rules to find nearest or furthest neighbor.
+	They also handle "score" and "rescore" which evaluate the nodes of a tree to see if we should search in
+	the subtrees.  Lower scores mean the boundary is closer to the query.
+
+../metrics/ip_metric.hpp
+../metrics/ip_metric_impl.hpp
+	Inner product metrics.
+../metrics/lmetric.hpp
+../metrics/lmetric_impl.hpp
+	Lp space metrics.
+../metrics/mahalanobis_distance.hpp
+../metrics/mahalanobis_distance_impl.hpp
+	Mahalanobis distance based metrics.
+ballbound.hpp
+ballbound_impl.hpp
+	Hypersphere bounds.  Used to bound the points in a node.
+bounds.hpp
+	Handle the different types of bounds.  Currently there are hyperspheres and hyperrectangles.
+binary_space_tree/mean_split.hpp
+binary_space_tree/mean_split_impl.hpp
+	Handles the splitting of a node in the Binary Space Tree.  The split is in the dimension with the largest range
+	and the split value is the arithmetic mean of that range.
+binary_space_tree/dual_tree_traverser.hpp
+binary_space_tree/dual_tree_traverser_impl.hpp
+	Traverse two trees to find the neighbors.
+binary_space_tree/single_tree_traverser.hpp
+binary_space_tree/single_tree_traverser_impl.hpp
+	Traverse one tree to find the neighbors.
+hrectbound.hpp
+hrectbound_impl.hpp
+	Hyperrectangle bounds.  Used to bound the points in a node.
+			
diff --git a/src/mlpack/core/tree/rectangle_tree/rectangle_tree_impl.hpp b/src/mlpack/core/tree/rectangle_tree/rectangle_tree_impl.hpp
index 8dea9f3..dd063a4 100644
--- a/src/mlpack/core/tree/rectangle_tree/rectangle_tree_impl.hpp
+++ b/src/mlpack/core/tree/rectangle_tree/rectangle_tree_impl.hpp
@@ -13,8 +13,9 @@ namespace mlpack {
 namespace tree {
 
 template<typename StatisticType,
-	   typename MatType>
-RectangleTree<StatisticType, MatType>::RectangleTree()
+	 typename MatType,
+	 typename SplitType>
+RectangleTree<StatisticType, MatType, SplitType>::RectangleTree()
 
 
 }; //namespace tree

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list