[mlpack-git] master: Remove 'metric' member; we can use it statically. (dfc6156)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Wed Apr 29 14:43:36 EDT 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/ee384655c4462e422e343e9725437fd772ca4449...182d4a629c1b23f683dff7b284844e4e3e9f5cc4

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

commit dfc6156bc1ba6a00f8950f7b14874e3e2ef20372
Author: Ryan Curtin <ryan at ratml.org>
Date:   Fri Mar 27 05:12:54 2015 +0000

    Remove 'metric' member; we can use it statically.


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

dfc6156bc1ba6a00f8950f7b14874e3e2ef20372
 src/mlpack/methods/mean_shift/mean_shift_impl.hpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/methods/mean_shift/mean_shift_impl.hpp b/src/mlpack/methods/mean_shift/mean_shift_impl.hpp
index acc580d..da6f05c 100644
--- a/src/mlpack/methods/mean_shift/mean_shift_impl.hpp
+++ b/src/mlpack/methods/mean_shift/mean_shift_impl.hpp
@@ -86,7 +86,7 @@ MeanShift<
 CalcWeight(const arma::colvec& centroid, const arma::colvec& point,
            double& weight) {
 
-  double distance = metric.Evaluate(centroid, point);
+  double distance = EuclideanDistance::Evaluate(centroid, point);
   if (distance >= radius || distance == 0) {
     return false;
   }
@@ -149,7 +149,7 @@ Cluster(const MatType& data,
       arma::Col<double> mhVector = newCentroid - allCentroids.col(i);
 
       // If the mean shift vector is small enough, it has converged.
-      if (metric.Evaluate(newCentroid, allCentroids.col(i)) < 1e-3 * radius) {
+      if (EuclideanDistance::Evaluate(newCentroid, allCentroids.col(i)) < 1e-3 * radius) {
 
         // Determine if the new centroid is duplicate with old ones.
         bool isDuplicated = false;
@@ -189,3 +189,4 @@ Cluster(const MatType& data,
 
 }; // namespace meanshift
 }; // namespace mlpack
+



More information about the mlpack-git mailing list