Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/inference/static/@jtree_sparse_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 [clpot, seppot] = init_pot(engine, clique, potential, pot_type, onodes); | |
9 [clpot, seppot] = collect_evidence(engine, clpot, seppot); | |
10 [clpot, seppot] = distribute_evidence(engine, clpot, seppot); | |
11 | |
12 C = length(clpot); | |
13 ll = zeros(1, C); | |
14 for i=1:C | |
15 [clpot{i}, ll(i)] = normalize_pot(clpot{i}); | |
16 end | |
17 loglik = ll(1); % we can extract the likelihood from any clique | |
18 | |
19 |