资源简介
hmm算法matlab实现和实例
hmm_em.m
function [LL, prior, transmat, obsmat, nrIterations] = ...
dhmm_em(data, prior, transmat, obsmat, varargin)
% LEARN_DHMM Find the ML/MAP parameters of an HMM with discrete outputs using EM.
% [ll_trace, prior, transmat, obsmat, iterNr] = learn_dhmm(data, prior0, transmat0, obsmat0, ...)
%
% Notation: Q(t) = hidden state, Y(t) = observation
%
% INPUTS:
% data{ex} or data(ex,:) if all sequences have the same length
% prior(i)
% transmat(i,j)
% obsmat(i,o)
%
% Optional parameters may be passed as 'param_name', param_value pairs.
% Parameter names are shown below; default values in [] - if none, argument is mandatory.
%
% 'max_iter' - max number of EM iterations [10]
% 'thresh' - convergence threshold [1e-4]
% 'verbose' - if 1, print out loglik at every iteration [1]
% 'obs_prior_weight' - weight to apply to uniform dirichlet prior on observation matrix [0]
%
% To clamp some of the parameters, so learning does not change them:
% 'adj_prior' - if 0, do not change prior [1]
% 'adj_trans' - if 0, do not change transmat [1]
% 'adj_obs' - if 0, do not change obsmat [1]
%
% Modified by Herbert Jaeger so xi are not computed individually
% but only their sum (over time) as xi_summed; this is the only way how they are used
% and it saves a lot of memory.
[max_iter, thresh, verbose, obs_prior_weight, adj_prior, adj_trans, adj_obs] = ...
process_options(varargin, 'max_iter', 10, 'thresh', 1e-4, 'verbose', 1, ...
'obs_prior_weight', 0, 'adj_prior', 1, 'adj_trans', 1, 'adj_obs', 1);
previous_loglik = -inf;
loglik = 0;
converged = 0;
num_iter = 1;
LL = [];
if ~iscell(data)
data = num2cell(data, 2); % each row gets its own cell
end
while (num_iter <= max_iter) & ~converged
% E step
[loglik, exp_num_trans, exp_num_visits1, exp_num_emit] = ...
compute_ess_dhmm(prior, transmat, obsmat, data, obs_prior_weight);
% M step
if adj_prior
prior = normalise(exp_num_visits1);
end
if adj_trans & ~isempty(exp_num_trans)
tran
代码片段和文件信息
- 上一篇:思典-粒子群优化Matlab工具箱
- 下一篇:V-M双闭环直流可逆调速建模与仿真课设
相关资源
- 隐马尔科夫模型程序范例
- HMM算法的语音识别的matlab程序
- 关与隐马尔科夫hmm的程序,是用MATL
- HMM的Matlab代码
- 基于 HMM算法的语音识别的matlab程序
- HMM工具箱,隐马尔可夫matlab工具
- MATLAB环境下的基于HMM模型的语音识别
- hmm的matlab源代码
- hmm 自己修改的程序代码
- Baum-Welch算法迭代估计隐马尔科夫模型
- GMM,HMM的语音识别,说话人识别源码
- 基于HMM和DTW算法的孤立词识别
- 孤立词语音识别系统的MATLAB实现
- hmm的MATLAB程序
- hmm工具箱(matlab工具箱)
- HMMforspeechrecogntion 一个可执行的HMM语音
- hmm
- speechRHMM HMM语音识别的matlab程序
- Coop_MIMO_Cellular_HMMD_Ergodic 3GPP LTE-Advan
- HMMshuziyuyinshibie 基于HMM的数字语音识别
- HMM_GMM 一个有效的
- HMM_SVM 用matlab实现的基于马尔科夫模型
- CHMM的MATLAB实现
评论
共有 条评论