[mlpack-git] master: Mark parent as pruned if its children are pruned. (0968f53)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Mar 12 16:03:03 EDT 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/eddd7167d69b6c88b271ef2e51d1c20e13f1acd8...70342dd8e5c17e0c164cfb8189748671e9c0dd44
>---------------------------------------------------------------
commit 0968f5374f67bcf23dcf33bdd703504e0300a265
Author: Ryan Curtin <ryan at ratml.org>
Date: Mon Feb 2 21:43:28 2015 -0500
Mark parent as pruned if its children are pruned.
>---------------------------------------------------------------
0968f5374f67bcf23dcf33bdd703504e0300a265
src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp b/src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp
index 9e26e40..e6747e5 100644
--- a/src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp
+++ b/src/mlpack/methods/kmeans/dtnn_kmeans_impl.hpp
@@ -369,12 +369,13 @@ oldFromNewCentroids[assignments(0, node.Point(i - 1))] << ".\n";
{
// The node isn't owned by a single cluster. But if it has no points and
// its children are all pruned, we may prune it too.
-// if (childrenPruned && node.NumChildren() > 0)
-// {
+ if (childrenPruned && node.NumChildren() > 0)
+ {
// Log::Warn << "Prune parent node " << node.Point(0) << "c" <<
//node.NumDescendants() << ".\n";
-// node.Stat().Pruned() = true;
-// }
+ node.Stat().Pruned() = true;
+ node.Stat().Owner() = centroids.n_cols;
+ }
// if (node.NumChildren() > 0)
// if (node.Child(0).Stat().Pruned() && !node.Child(1).Stat().Pruned())
// Log::Warn << "Node left child pruned but right child not:\n" <<
More information about the mlpack-git
mailing list