annotate toolboxes/FullBNT-1.0.7/bnt/inference/static/@jtree_inf_engine/collect_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, seppot] = collect_evidence(engine, clpot, seppot)
wolffd@0 2 % COLLECT_EVIDENCE Do message passing from leaves to root (children then parents)
wolffd@0 3 % [clpot, seppot] = collect_evidence(engine, clpot, seppot)
wolffd@0 4
wolffd@0 5 for n=engine.postorder %postorder(1:end-1)
wolffd@0 6 for p=engine.postorder_parents{n}
wolffd@0 7 %clpot{p} = divide_by_pot(clpot{n}, seppot{p,n}); % dividing by 1 is redundant
wolffd@0 8 seppot{p,n} = marginalize_pot(clpot{n}, engine.separator{p,n}, engine.maximize);
wolffd@0 9 clpot{p} = multiply_by_pot(clpot{p}, seppot{p,n});
wolffd@0 10 end
wolffd@0 11 end
wolffd@0 12