comparison toolboxes/FullBNT-1.0.7/bnt/inference/static/@jtree_inf_engine/enter_soft_evidence.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, loglik] = enter_soft_evidence(engine, clique, potential, onodes, pot_type)
2 % ENTER_SOFT_EVIDENCE Add the specified potentials to the network (jtree)
3 % [clpot, loglik] = enter_soft_evidence(engine, clique, potential, onodes, pot_type, maximize)
4 %
5 % We multiply potential{i} onto clique(i) before propagating.
6 % We return all the modified clique potentials.
7
8 % only used by BK!
9
10 [clpot, seppot] = init_pot(engine, clique, potential, pot_type, onodes);
11 [clpot, seppot] = collect_evidence(engine, clpot, seppot);
12 [clpot, seppot] = distribute_evidence(engine, clpot, seppot);
13
14 C = length(clpot);
15 ll = zeros(1, C);
16 for i=1:C
17 [clpot{i}, ll(i)] = normalize_pot(clpot{i});
18 end
19 loglik = ll(1); % we can extract the likelihood from any clique
20
21