[mlpack-git] master: Use the maxIterartion as template parameter. (c438f4e)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:57:54 EST 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

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

commit c438f4e7a66e161dde999d695a83edd61f3d88dd
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date:   Fri Aug 15 16:54:10 2014 +0000

    Use the maxIterartion as template parameter.


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

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



More information about the mlpack-git mailing list