[mlpack-git] [mlpack] hmm_train failed to converge (#496)

Ryan Curtin notifications at github.com
Wed Jan 13 16:46:04 EST 2016


Hey Davud,

Sorry for the slow response; I was out of town for a while too. :)

I did some digging, and I think I've solved the issue in c505098.  Here is what I think was happening:

During training, some Gaussians end up having particularly small covariances.  This happens in part because many of the points in your dataset are identical.  A very small covariance for a Gaussian means that the probability of a point centered at the mean will be extremely large; for sufficiently small covariances, this results in the probability being represented as inf on the machine.  Then, later in the EM fitting process, normalization of probabilities turns this inf into a NaN, which ends up propagating to the covariance, which will end up full of NaNs.  When the covariance is full of NaNs, the "Adding perturbation" step will continue forever, because no matter how large a number you add to a matrix full of NaNs, it still won't be positive definite.

So, what I've done is modified the positive definiteness constraint to also enforce a minimum diagonal covariance element of 1e-50 (very small), thus restricting how small a single Gaussian's PDF can get.  This means that the probability of a point at the mean is bounded within the range of numbers representable by the machine, so there is no inf, and there aren't NaNs later.

But, it's possible that I did not properly solve the issue, so please reopen if you still have issues.  I am more than happy to help work out issues like this. :)

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/496#issuecomment-171446246
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160113/7d263a96/attachment.html>


More information about the mlpack-git mailing list