Mercurial > hg > camir-ismir2012
comparison toolboxes/FullBNT-1.0.7/bnt/inference/dynamic/@hmm_inf_engine/marginal_nodes.m @ 0:cc4b1211e677 tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author | Daniel Wolff |
---|---|
date | Fri, 19 Aug 2016 13:07:06 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:cc4b1211e677 |
---|---|
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 |