I See Dead Code

… as sounding brass, or a tinkling cymbal.

I See Dead Code header image 2

GMM Code

March 13th, 2008 · No Comments

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.

Callgraph of the C++ version

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.

Tags: coli · lang:en · programming

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment