[mlpack-git] master: No need to reset the bounds when un-pruning. They've been updated correctly all along, even when the node is pruned. (7aac685)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 12 16:03:22 EDT 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/eddd7167d69b6c88b271ef2e51d1c20e13f1acd8...70342dd8e5c17e0c164cfb8189748671e9c0dd44

>---------------------------------------------------------------

commit 7aac685e68a7a718243681228f78e624fc4acc50
Author: Ryan Curtin <ryan at ratml.org>
Date:   Mon Feb 2 17:49:28 2015 -0500

    No need to reset the bounds when un-pruning. They've been updated correctly all along, even when the node is pruned.


>---------------------------------------------------------------

7aac685e68a7a718243681228f78e624fc4acc50
 src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp b/src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp
index d9d56f3..ff56e13 100644
--- a/src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp
+++ b/src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp
@@ -418,15 +418,13 @@ oldFromNewCentroids[assignments(0, node.Point(i - 1))] << ".\n";
           interclusterDistances[newFromOldCentroids[node.Stat().Owner()]])
       {
         // The node remains pruned.  Adjust the bounds for next iteration.
-        node.Stat().MaxClusterDistance() += clusterDistances[node.Stat().Owner()];
+        node.Stat().MaxClusterDistance() +=
+            clusterDistances[node.Stat().Owner()];
         node.Stat().SecondClusterBound() -= clusterDistances[centroids.n_cols];
       }
       else
       {
         node.Stat().Pruned() = false;
-        node.Stat().FirstBound() = DBL_MAX;
-        node.Stat().SecondBound() = DBL_MAX;
-        node.Stat().Bound() = DBL_MAX;
         node.Stat().MaxClusterDistance() = DBL_MAX;
         node.Stat().SecondClusterBound() = 0.0;
       }



More information about the mlpack-git mailing list