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