Mercurial > hg > camir-aes2014
annotate toolboxes/FullBNT-1.0.7/bnt/inference/online/@hmm_2TBN_inf_engine/back.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
rev | line source |
---|---|
wolffd@0 | 1 function b = back(engine, bfuture, f, t) |
wolffd@0 | 2 |
wolffd@0 | 3 if f.t ~= t |
wolffd@0 | 4 error('mixed up time stamps') |
wolffd@0 | 5 end |
wolffd@0 | 6 |
wolffd@0 | 7 b.t = t; |
wolffd@0 | 8 b.obslik = f.obslik; |
wolffd@0 | 9 bb_future = bfuture.beta .* bfuture.obslik; |
wolffd@0 | 10 if engine.maximize |
wolffd@0 | 11 B = repmat(bb_future(:)', length(bfuture.beta), 1); |
wolffd@0 | 12 b.beta = normalise(max(engine.transprob .* B, [], 2)); |
wolffd@0 | 13 else |
wolffd@0 | 14 b.beta = normalise((engine.transprob * bb_future)); |
wolffd@0 | 15 end |
wolffd@0 | 16 b.gamma = normalise(f.alpha .* b.beta); |
wolffd@0 | 17 if t > 1 |
wolffd@0 | 18 bb_t = b.beta .* b.obslik; |
wolffd@0 | 19 b.xi = normalise((engine.transprob .* (f.past_alpha * bb_t'))); % t-1,t |
wolffd@0 | 20 end |
wolffd@0 | 21 |