[mlpack-svn] r16209 - mlpack/trunk/src/mlpack/methods/gmm
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Feb 4 17:02:28 EST 2014
Author: birm
Date: Tue Feb 4 17:02:27 2014
New Revision: 16209
Log:
Added ToString to GMM
Modified:
mlpack/trunk/src/mlpack/methods/gmm/gmm.hpp
mlpack/trunk/src/mlpack/methods/gmm/gmm_impl.hpp
Modified: mlpack/trunk/src/mlpack/methods/gmm/gmm.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/gmm/gmm.hpp (original)
+++ mlpack/trunk/src/mlpack/methods/gmm/gmm.hpp Tue Feb 4 17:02:27 2014
@@ -334,6 +334,11 @@
void Classify(const arma::mat& observations,
arma::Col<size_t>& labels) const;
+ /**
+ * Returns a string representation of this object.
+ */
+ std::string ToString() const;
+
private:
/**
* This function computes the loglikelihood of the given model. This function
@@ -363,3 +368,4 @@
#include "gmm_impl.hpp"
#endif
+
Modified: mlpack/trunk/src/mlpack/methods/gmm/gmm_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/gmm/gmm_impl.hpp (original)
+++ mlpack/trunk/src/mlpack/methods/gmm/gmm_impl.hpp Tue Feb 4 17:02:27 2014
@@ -476,7 +476,16 @@
return loglikelihood;
}
+template<typename FittingType>
+std::string GMM<FittingType>::ToString() const
+{
+ std::ostringstream convert;
+ convert << "GMM [" << this << "]" << std::endl;
+ return convert.str();
+}
+
}; // namespace gmm
}; // namespace mlpack
#endif
+
More information about the mlpack-svn
mailing list