Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/inference/dynamic/@hmm_inf_engine/find_mpe.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function mpe = find_mpe(engine, evidence) | |
2 % FIND_MPE Find the most probable explanation (Viterbi) | |
3 % mpe = enter_evidence(engine, evidence, ...) | |
4 % | |
5 % evidence{i,t} = [] if if X(i,t) is hidden, and otherwise contains its observed value (scalar or column vector) | |
6 % | |
7 | |
8 obslik = mk_hmm_obs_lik_matrix(engine, evidence); | |
9 path = viterbi_path(engine.startprob, engine.transprob, obslik); | |
10 bnet = bnet_from_engine(engine); | |
11 ns = bnet.node_sizes_slice; | |
12 ns(bnet.observed) = 1; | |
13 ass = ind2subv(ns, path); | |
14 mpe = num2cell(ass'); | |
15 mpe(bnet.observed,:) = evidence(bnet.observed,:); | |
16 |