Reported by Madda on 20 Aug 43843604 13:24 UTC
I am using the GMM class with the EMFit clustering method GMM<EMFit<> >.
I am passing initial values of means, covariances and weights, previously estimated:
GMM<EMFit<> > ml_gmm(initial_means, initial_covariances, initail_weights);
I thought that the Estimate function starts the EM from these values, but the first step is to calculate the parameters with the function InitialClustering.
Am I understanding it wrong? It is possible to start the EM from some initial values? Maybe commenting out the InitialClustering call in em_fit_impl.hpp?
Thanks a lot,
Commented by rcurtin on 25 Nov 43849965 09:06 UTC
I am in the process of writing a GMM tutorial but it is not done yet, unfortunately.
You are right that the Estimate() function does not start EM from the values you passed in. I have committed a fix to trunk (r16000 and r16001) that implement support for this by adding an extra boolean parameter to Estimate() that indicates that the existing model should be used as the initial model for the training.
So an example might be:
GMM<> ml_gmm(initial_means, initial_covariances, initial_weights);
ml_gmm.Estimate(data, 1, true); // true indicates to use the current model is the initial model
You can either update to the current svn version, or drop the four files I have attached (em_fit.hpp, em_fit_impl.hpp, gmm.hpp, and gmm_impl.hpp) in the src/mlpack/methods/gmm/ directory, overwriting the ones that came with mlpack 1.0.7.
Let me know if you have any problems.
Commented by Madda on 5 Oct 43853509 04:09 UTC