GMM initial parameter values #296

Closed
rcurtin opened this Issue Dec 29, 2014 · 2 comments

Projects

None yet

1 participant

@rcurtin
Member
rcurtin commented Dec 29, 2014

Reported by Madda on 20 Aug 43843604 13:24 UTC
Hello,

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,
Madda

@rcurtin rcurtin self-assigned this Dec 29, 2014
@rcurtin rcurtin added this to the mlpack 1.0.8 milestone Dec 29, 2014
@rcurtin rcurtin closed this Dec 29, 2014
@rcurtin
Member
rcurtin commented Dec 30, 2014

Commented by rcurtin on 25 Nov 43849965 09:06 UTC
Hello Madda,

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.

Thanks,

Ryan

@rcurtin
Member
rcurtin commented Dec 30, 2014

Commented by Madda on 5 Oct 43853509 04:09 UTC
Hi Ryan,

it worked!

Thanks again,
Madda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment