[mlpack-git] master: Rename Estimate() to Train(). (9999ec9)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Fri Dec 18 11:43:04 EST 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/5ba11bc90223b55eecd5da4cfbe86c8fc40637a5...df229e45a5bd7842fe019e9d49ed32f13beb6aaa

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

commit 9999ec9b86424e235f5f51b7f788856fc1749e88
Author: Ryan Curtin <ryan at ratml.org>
Date:   Wed Dec 16 21:00:33 2015 +0000

    Rename Estimate() to Train().


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

9999ec9b86424e235f5f51b7f788856fc1749e88
 src/mlpack/methods/gmm/gmm.hpp      | 18 +++++++++---------
 src/mlpack/methods/gmm/gmm_impl.hpp | 31 +++++++++++++++----------------
 2 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/src/mlpack/methods/gmm/gmm.hpp b/src/mlpack/methods/gmm/gmm.hpp
index 7ee4b0d..99409b9 100644
--- a/src/mlpack/methods/gmm/gmm.hpp
+++ b/src/mlpack/methods/gmm/gmm.hpp
@@ -22,7 +22,7 @@ namespace gmm /** Gaussian Mixture Models. */ {
  * functions to estimate the parameters of the GMM on a given dataset via the
  * given fitting mechanism, defined by the FittingType template parameter.  The
  * GMM can be trained using normal data, or data with probabilities of being
- * from this GMM (see GMM::Estimate() for more information).
+ * from this GMM (see GMM::Train() for more information).
  *
  * The FittingType template class must provide a way for the GMM to train on
  * data.  It must provide the following two functions:
@@ -274,9 +274,9 @@ class GMM
    *      model for the estimation.
    * @return The log-likelihood of the best fit.
    */
-  double Estimate(const arma::mat& observations,
-                  const size_t trials = 1,
-                  const bool useExistingModel = false);
+  double Train(const arma::mat& observations,
+               const size_t trials = 1,
+               const bool useExistingModel = false);
 
   /**
    * Estimate the probability distribution directly from the given observations,
@@ -302,10 +302,10 @@ class GMM
    *     model for the estimation.
    * @return The log-likelihood of the best fit.
    */
-  double Estimate(const arma::mat& observations,
-                  const arma::vec& probabilities,
-                  const size_t trials = 1,
-                  const bool useExistingModel = false);
+  double Train(const arma::mat& observations,
+               const arma::vec& probabilities,
+               const size_t trials = 1,
+               const bool useExistingModel = false);
 
   /**
    * Classify the given observations as being from an individual component in
@@ -335,7 +335,7 @@ class GMM
  private:
   /**
    * This function computes the loglikelihood of the given model.  This function
-   * is used by GMM::Estimate().
+   * is used by GMM::Train().
    *
    * @param dataPoints Observations to calculate the likelihood for.
    * @param means Means of the given mixture model.
diff --git a/src/mlpack/methods/gmm/gmm_impl.hpp b/src/mlpack/methods/gmm/gmm_impl.hpp
index 18fdc19..fd322c5 100644
--- a/src/mlpack/methods/gmm/gmm_impl.hpp
+++ b/src/mlpack/methods/gmm/gmm_impl.hpp
@@ -176,9 +176,9 @@ arma::vec GMM<FittingType>::Random() const
  * Fit the GMM to the given observations.
  */
 template<typename FittingType>
-double GMM<FittingType>::Estimate(const arma::mat& observations,
-                                  const size_t trials,
-                                  const bool useExistingModel)
+double GMM<FittingType>::Train(const arma::mat& observations,
+                               const size_t trials,
+                               const bool useExistingModel)
 {
   double bestLikelihood; // This will be reported later.
 
@@ -212,8 +212,7 @@ double GMM<FittingType>::Estimate(const arma::mat& observations,
 
     bestLikelihood = LogLikelihood(observations, dists, weights);
 
-    Log::Info << "GMM::Estimate(): Log-likelihood of trial 0 is "
-        << bestLikelihood << "." << std::endl;
+    Log::Info << "GMM::Train(): Log-likelihood of trial 0 is " << bestLikelihood        << "." << std::endl;
 
     // Now the temporary model.
     std::vector<distribution::GaussianDistribution> distsTrial(gaussians,
@@ -235,8 +234,8 @@ double GMM<FittingType>::Estimate(const arma::mat& observations,
       double newLikelihood = LogLikelihood(observations, distsTrial,
           weightsTrial);
 
-      Log::Info << "GMM::Estimate(): Log-likelihood of trial " << trial
-          << " is " << newLikelihood << "." << std::endl;
+      Log::Info << "GMM::Train(): Log-likelihood of trial " << trial << " is "
+          << newLikelihood << "." << std::endl;
 
       if (newLikelihood > bestLikelihood)
       {
@@ -250,7 +249,7 @@ double GMM<FittingType>::Estimate(const arma::mat& observations,
   }
 
   // Report final log-likelihood and return it.
-  Log::Info << "GMM::Estimate(): log-likelihood of trained GMM is "
+  Log::Info << "GMM::Train(): log-likelihood of trained GMM is "
       << bestLikelihood << "." << std::endl;
   return bestLikelihood;
 }
@@ -260,10 +259,10 @@ double GMM<FittingType>::Estimate(const arma::mat& observations,
  * probability of being from this distribution.
  */
 template<typename FittingType>
-double GMM<FittingType>::Estimate(const arma::mat& observations,
-                                  const arma::vec& probabilities,
-                                  const size_t trials,
-                                  const bool useExistingModel)
+double GMM<FittingType>::Train(const arma::mat& observations,
+                               const arma::vec& probabilities,
+                               const size_t trials,
+                               const bool useExistingModel)
 {
   double bestLikelihood; // This will be reported later.
 
@@ -297,7 +296,7 @@ double GMM<FittingType>::Estimate(const arma::mat& observations,
 
     bestLikelihood = LogLikelihood(observations, dists, weights);
 
-    Log::Debug << "GMM::Estimate(): Log-likelihood of trial 0 is "
+    Log::Debug << "GMM::Train(): Log-likelihood of trial 0 is "
         << bestLikelihood << "." << std::endl;
 
     // Now the temporary model.
@@ -320,8 +319,8 @@ double GMM<FittingType>::Estimate(const arma::mat& observations,
       double newLikelihood = LogLikelihood(observations, distsTrial,
           weightsTrial);
 
-      Log::Debug << "GMM::Estimate(): Log-likelihood of trial " << trial
-          << " is " << newLikelihood << "." << std::endl;
+      Log::Debug << "GMM::Train(): Log-likelihood of trial " << trial << " is "
+          << newLikelihood << "." << std::endl;
 
       if (newLikelihood > bestLikelihood)
       {
@@ -335,7 +334,7 @@ double GMM<FittingType>::Estimate(const arma::mat& observations,
   }
 
   // Report final log-likelihood and return it.
-  Log::Info << "GMM::Estimate(): log-likelihood of trained GMM is "
+  Log::Info << "GMM::Train(): log-likelihood of trained GMM is "
       << bestLikelihood << "." << std::endl;
   return bestLikelihood;
 }



More information about the mlpack-git mailing list