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