[mlpack-svn] [MLPACK] #211: Suggested additional functionality to GMM
MLPACK Trac
trac at coffeetalk-1.cc.gatech.edu
Tue Apr 10 14:52:44 EDT 2012
#211: Suggested additional functionality to GMM
-----------------------------------+----------------------------------------
Reporter: Adam | Owner:
Type: enhancement | Status: new
Priority: major | Milestone:
Component: mlpack | Resolution:
Keywords: GMM, EM, IGMM, DPGMM | Blocking:
Blocked By: |
-----------------------------------+----------------------------------------
Comment (by rcurtin):
Okay; I've been working on this for a while. Now GMM is a templated class
which allows any number of fitting methods. The default is the EM
algorithm (which can use any initial clustering mechanism, other than the
default KMeans):
{{{
template<typename FittingType = EMFit<> >
class GMM<FittingType>;
}}}
The FittingType class needs to implement the following two functions:
{{{
void Estimate(const arma::mat& observations,
std::vector<arma::vec>& means,
std::vector<arma::mat>& covariances,
arma::vec& weights);
void Estimate(const arma::mat& observations,
const arma::vec& probabilities,
std::vector<arma::vec>& means,
std::vector<arma::mat>& covariances,
arma::vec& weights);
}}}
These functions should produce a trained GMM from the given observations
and probabilities. These may modify the size of the model (by increasing
the size of the mean and covariance vectors as well as the weight
vectors), but
the method should expect that these vectors are already set to the size of
the GMM as specified in the constructor.
The EMFit type, in `gmm/em_fit.hpp` and `gmm/em_fit_impl.hpp` provide an
example implementation of the EMFit class.
So hopefully, if you are writing an IGMM fitting type, you can plug it
right in without having to modify the GMM code at all.
If the API needs any changes, let me know. Sorry this took so long; I
kept stumbling over simple compilation issues.
--
Ticket URL: <http://trac.research.cc.gatech.edu/fastlab/ticket/211#comment:3>
MLPACK <www.fast-lab.org>
MLPACK is an intuitive, fast, and scalable C++ machine learning library developed by the FASTLAB at Georgia Tech under Dr. Alex Gray.
More information about the mlpack-svn
mailing list