Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/inference/dynamic/@hmm_inf_engine/marginal_nodes.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 marginal = marginal_nodes(engine, nodes, t, add_ev) | |
2 % MARGINAL_NODES Compute the marginal on the specified query nodes (hmm) | |
3 % marginal = marginal_nodes(engine, nodes, t, add_ev) | |
4 % | |
5 % 'nodes' must be a single node. | |
6 % t is the time slice. | |
7 | |
8 if nargin < 3, t = 1; end | |
9 if nargin < 4, add_ev = 0; end | |
10 | |
11 assert(length(nodes)==1) | |
12 ss = engine.slice_size; | |
13 | |
14 i = nodes(1); | |
15 bigT = engine.one_slice_marginal(:,t); | |
16 dom = i + (t-1)*ss; | |
17 | |
18 ns = engine.eff_node_sizes(:); | |
19 bigdom = 1:ss; | |
20 marginal.T = marg_table(bigT, bigdom + (t-1)*ss, ns(bigdom), dom, engine.maximize); | |
21 | |
22 marginal.domain = dom; | |
23 marginal.mu = []; | |
24 marginal.Sigma = []; | |
25 | |
26 if add_ev | |
27 marginal = add_ev_to_dmarginal(marginal, engine.evidence, engine.node_sizes); | |
28 end | |
29 |