Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/inference/dynamic/@bk_ff_hmm_inf_engine/bk_ff_hmm_inf_engine.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 engine = bk_ff_hmm_inf_engine(bnet) | |
2 % BK_FF_HMM_INF_ENGINE Naive (HMM-based) implementation of fully factored form of Boyen-Koller | |
3 % engine = bk_ff_hmm_inf_engine(bnet) | |
4 % | |
5 % This is implemented on top of the forwards-backwards algo for HMMs, | |
6 % so it is *less* efficient than exact inference! However, it is good for educational purposes, | |
7 % because it illustrates the BK algorithm very clearly. | |
8 | |
9 [persistent_nodes, transient_nodes] = partition_dbn_nodes(bnet.intra, bnet.inter); | |
10 assert(isequal(sort(bnet.observed), transient_nodes)); | |
11 [engine.prior, engine.transmat] = dbn_to_hmm(bnet); | |
12 | |
13 ss = length(bnet.intra); | |
14 | |
15 engine.bel = []; | |
16 engine.bel_marginals = []; | |
17 engine.marginals = []; | |
18 | |
19 | |
20 engine = class(engine, 'bk_ff_hmm_inf_engine', inf_engine(bnet)); | |
21 |