[mlpack] 320/324: Use the maxIterartion as template parameter.

Barak A. Pearlmutter barak+git at cs.nuim.ie
Sun Aug 17 08:22:22 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 08224bf016ed18877ed1b70a19997cd9c387dbeb
Author: marcus <marcus at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Fri Aug 15 16:54:10 2014 +0000

    Use the maxIterartion as template parameter.
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@17033 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/methods/nystroem_method/kmeans_selection.hpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/mlpack/methods/nystroem_method/kmeans_selection.hpp b/src/mlpack/methods/nystroem_method/kmeans_selection.hpp
index ea6cbbc..c6d5837 100644
--- a/src/mlpack/methods/nystroem_method/kmeans_selection.hpp
+++ b/src/mlpack/methods/nystroem_method/kmeans_selection.hpp
@@ -14,7 +14,13 @@
 namespace mlpack {
 namespace kernel {
 
-template<typename ClusteringType = kmeans::KMeans<> >
+/**
+ * Implementation of the kmeans sampling scheme.
+ *
+ * @tparam ClusteringType Type of clustering.
+ * @tparam maxIterations Maximum number of iterations allowed before giving up.
+ */
+template<typename ClusteringType = kmeans::KMeans<>, size_t maxIterations = 5>
 class KMeansSelection
 {
  public:
@@ -26,9 +32,7 @@ class KMeansSelection
    * @param m Number of points to select.
    * @return Matrix pointer in which centroids are stored.
    */
-  const static arma::mat* Select(const arma::mat& data,
-                                 const size_t m,
-                                 const size_t maxIterations = 5)
+  const static arma::mat* Select(const arma::mat& data, const size_t m)
   {
     arma::Col<size_t> assignments;
     arma::mat* centroids = new arma::mat;

-- 
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