我将重写一个在 Python 中使用 Kevin Murphy 工具箱的 MATLAB 脚本。
我知道在 python 中有一些 HMM 算法实现(Viterbi、Baum Welch、Backword Forward),所以我认为我拥有移植 matlab--> python 所需的一切。
我的 MATLAB 脚本使用 learn_dhmm.m 中编写的过程:
function [LL, prior, transmat, obsmat, gamma] = learn_dhmm(data, prior, transmat, obsmat, max_iter, thresh, verbose, act, adj_prior, adj_trans, adj_obs, dirichlet)
% LEARN_HMM Find the ML parameters of an HMM with discrete outputs using EM.
%
% [LL, PRIOR, TRANSMAT, OBSMAT] = LEARN_HMM(DATA, PRIOR0, TRANSMAT0, OBSMAT0)
% computes maximum likelihood estimates of the following parameters,
% where, for each time t, Q(t) is the hidden state, and
% Y(t) is the observation
% prior(i) = Pr(Q(1) = i)
% transmat(i,j) = Pr(Q(t+1)=j | Q(t)=i)
% obsmat(i,o) = Pr(Y(t)=o | Q(t)=i)
% It uses PRIOR0 as the initial estimate of PRIOR, etc.
我不明白这个程序实际上做了什么。
抱歉,我刚开始学习机加工