comparison toolboxes/FullBNT-1.0.7/bnt/inference/static/@jtree_inf_engine/init_pot.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 [clpot, seppot] = init_pot(engine, clqs, pots, pot_type, onodes, ndx)
2 % INIT_POT Initialise potentials with evidence (jtree_inf)
3 % function [clpot, seppot] = init_pot(engine, clqs, pots, pot_type, onodes)
4
5 cliques = engine.cliques;
6 bnet = bnet_from_engine(engine);
7 % Set the clique potentials to all 1s
8 C = length(cliques);
9 clpot = cell(1,C);
10 for i=1:C
11 clpot{i} = mk_initial_pot(pot_type, cliques{i}, bnet.node_sizes(:), bnet.cnodes(:), onodes);
12 end
13
14 % Multiply on specified potentials
15 for i=1:length(clqs)
16 c = clqs(i);
17 clpot{c} = multiply_by_pot(clpot{c}, pots{i});
18 end
19
20 seppot = cell(C,C); % implicitely initialized to 1