mixture model training added; EM for mixture model added

- EM for mixture model
- mixture model training
- unittest for mixture model with gaussian distributions 
No.. thats why i said there is a need to refactor old cgaussian code... For
now its explicitly mentioned in the doc by the past author to free this
covarance matrix manually.. you can check that in the get_cov method doc.

On 7 Aug 2014 02:11, "Fernando Iglesias" <notifications@github.com> wrote:
>
> In tests/unit/distribution/MixtureModel_unittest.cc:
>
> > + weights[0]=0.5;
> > + weights[1]=0.5;
> > +
> > + CMixtureModel* mix=new CMixtureModel(comps,weights);
> > + mix->train(feats);
> > +
> > + CDistribution*
distr=CDistribution::obtain_from_generic(comps->get_element(0));
> > + CGaussian* outg=CGaussian::obtain_from_
> generic(distr);
> > + SGVector<float64_t> m=outg->get_mean();
> > + SGMatrix<float64_t> cov=outg->get_cov();
> > +
> > + float64_t eps=1e-8;
> > + EXPECT_NEAR(m[0],9.863760378,eps);
> > + EXPECT_NEAR(cov(0,0),0.956568199,eps);
> > +
> > + SG_FREE(cov.matrix);
>
> Why does free have to be explicitly called here? Is the automatic
reference counting of SGMatrix not used here?
>
> —
> Reply to this email directly or view it on GitHub.