# 隐马尔可夫模型推断：Viterbi 与前向-后向算法

> 来源：https://deeplearning.bnuai.com/demos/hmm-viterbi ｜ 作者：唐志清（北京师范大学） ｜ 更新：2026-11-01 ｜ 内容依据邱锡鹏《神经网络与深度学习》（https://nndl.ai/）及作者公开课件

> （此处为交互演示，请在网页中使用：https://deeplearning.bnuai.com/demos/hmm-viterbi）

## 观察要点

1. Viterbi 用动态规划求整体最优状态序列，复杂度 O(TK²)。
2. 前向-后向算法求每个时刻的边际后验。
3. 转移概率决定状态切换频繁程度，发射概率决定两种状态的可区分程度。

相关章节：[第 11 章　概率图模型](https://deeplearning.bnuai.com/chapters/11-probabilistic-graphical-models)、[第 15 章　序列生成模型](https://deeplearning.bnuai.com/chapters/15-sequence-generation)。
