前向-后向算法和维特比算法有什么区别?
n-gram 模型上的前向-后向算法和隐马尔可夫模型 (HMM) 上的维特比算法有什么区别?
当我回顾这两种算法的实现时,我唯一发现的是交易概率来自不同的概率模型。
这2种算法有区别吗?
What is the difference between Forward-backward algorithm on n-gram model and Viterbi algorithm on Hidden Markov model (HMM)?
When I review the implementation of these two algorithms, only thing I found is that the transaction probability is coming from different probabilistic models.
Is there a difference between these 2 algorithms?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
前向-后向算法结合了前向步骤和后向步骤来获得在特定时间处于每个状态的概率。因此,对所有时间步骤执行此操作可以为我们提供每次最可能状态的序列(尽管不能保证是有效序列,因为它考虑了每个步骤的单独状态,并且可能发生概率 p( q_i -> q_j)=0 在转换模型中),换句话说:
,其中
另一方面,维特比算法通过最大化不同的 optimality 准则:
我建议您参考这篇著名论文以获得详细解释(请参阅问题#2):
The Forward-Backward algorithm combines the forward step and the backward step to get the probability of being at each state at a specific time. Doing this for all time steps can therefore give us a sequence of individually most likely states at each time (although not guaranteed to be valid sequence, since it considers individual state at each step, and it can happen that the probability
p(q_i -> q_j)=0
in the transition model), in other words:, where
On the other hand, Viterbi algorithm finds the most likely state sequence given an observation sequence, by maximizing a different optimality criterion:
I suggest you refer to this well-known paper for a detailed explanation (see Problem #2):
简而言之:
如果只想预测某一特定时间最有可能的标记是什么,则使用前向-后向。它将考虑所有可能的序列并对它们进行平均以找到当时最可能的标记。因此,您将返回的序列不是真正的序列,而是当您考虑所有可能的序列时最可能的标记的集合。
维特比用于查找最可能的事件序列。这将查看每个序列并简单地选择最有可能的序列。
Succinctly put:
Forward-Backward is used if only want to predict what the most likely token is at one particular time. It will take every possible sequence into account and average over them to find the most likely token at that time. So the sequence you will get back won't be a true sequence, but a collect of the most probable tokens when you consider all of the possible sequences.
Viterbi is used to find the most likely sequence of events. This will look at every sequence and simply select the sequence that is most likely.
看看 Rabiner 的论文的第 262 - 264 页一切都应该清楚了。
这是直接引用本文中对您的问题的答案:
Take a look at the pages 262 - 264 of Rabiner's paper and it should all become clear.
Here is a directly quoted answer -from this paper- to your question: