下溢在转发算法隐马尔可夫模型 [英] Underflow in Forward Algorithm for HMMs

查看:218
本文介绍了下溢在转发算法隐马尔可夫模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实施前向算法的HMM计算给定的HMM的发射的给定观察序列的概率。我想我的算法是稳健的下溢。我不能在日志空间工作,因为前向算法需要的乘法和加法的概率。什么是避免溢出的最好方法是什么?

I'm implementing the forward algorithm for HMMs to calculate the probability of a given HMM emitting a given observation sequence. I'd like my algorithm to be robust to underflow. I can't work in log-space because the forward algorithm requires the multiplication AND addition of probabilities. What is the best way to avoid underflow?

我读过一些关于这个来源,但最好的建议,我得到的是缩放的概率在每个时间步的第6节在这里。由算法结束时,你将不会被留下你想(的观察序列)的精确概率。此外,除非我错了,如果你缩放的概率在每个时间步提出上述参考文献中,你不能做一个给定的观察序列的概率进行有意义的比较,有来自两个不同的HMM模型(找出哪些一个是更可能有输出的序列)。有什么建议?

I've read some sources about this but the best suggestion I get is scaling the probabilities at each time step Section 6 Here. By the end of the algorithm you won't be left with the exact probability you want (of the observation sequence). Also, unless I'm mistaken, if you scale probabilities at each time step as proposed in the above reference, you can't do a meaningful comparison of the probability of a given observation sequence having come from two different HMMs (to figure out which one is more likely to have output the sequence). Any suggestions?

推荐答案

在式(32)在你的参考结束时,你乘以每个概率值alpha_t(i)以C_T。因此,在年底已通过所有C_T的产品乘以你的最终概率。您可以通过保持数的总和(C_T)的轨迹跟踪这一切。那么,在年底就可以计算出日志(alpha_t(I)) - SUM_(J< = T)日志(C_j),这将给你最终的alpha_t(i)的数概率,或登录(SUM_t alpha_t(我)) - SUM_(J< = T)日志(C_j),这将给你的整个序列的数概率

In equation 32 at the end of your reference you multiply every probability value alpha_t(i) by C_t. So at the end you have multiplied your final probabilities by the product of all the C_t. You can keep track of all of this by keeping track of the sum of log(C_t). Then at the end you can work out log(alpha_t(i)) - SUM_(j <= t)log(C_j) which will give you the log probability of the final alpha_t(i), or log(SUM_t alpha_t(i)) - SUM_(j <= t)log(C_j) which will give you the log probability of the entire sequence.

这篇关于下溢在转发算法隐马尔可夫模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆