For one of the exercises, we had to implement the EM algorithm for Gaussian Mixture Models. I’ve spent a considerable amount of time on my solutions, either because I wanted to learn a new language (Scala version) or I wanted to not forgot an old one (C++ version), so I don’t want the code simply rotting on my hard drive.
The C++ version isn’t that much faster than the Scala version if I remember my experiments correctly (about 4x). Judging from the call graph of the C++ version, most of the time is spent in the exp function anyway, which is as fast as it gets.

The input file simply lists one float value per line, and the initial parameters for the Gaussians can be specified in the source files. Be advised that the number of Gaussians used to approximate the data needs to be known before the algorithm is run.

![Validate my RSS feed [Valid RSS]](http://shlomme.diotavelli.net/images/valid-rss.png)
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment