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