annotate toolboxes/FullBNT-1.0.7/bnt/inference/static/@jtree_inf_engine/collect_evidence.m @ 0:cc4b1211e677
tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author |
Daniel Wolff |
date |
Fri, 19 Aug 2016 13:07:06 +0200 |
parents |
|
children |
|
rev |
line source |
Daniel@0
|
1 function [clpot, seppot] = collect_evidence(engine, clpot, seppot)
|
Daniel@0
|
2 % COLLECT_EVIDENCE Do message passing from leaves to root (children then parents)
|
Daniel@0
|
3 % [clpot, seppot] = collect_evidence(engine, clpot, seppot)
|
Daniel@0
|
4
|
Daniel@0
|
5 for n=engine.postorder %postorder(1:end-1)
|
Daniel@0
|
6 for p=engine.postorder_parents{n}
|
Daniel@0
|
7 %clpot{p} = divide_by_pot(clpot{n}, seppot{p,n}); % dividing by 1 is redundant
|
Daniel@0
|
8 seppot{p,n} = marginalize_pot(clpot{n}, engine.separator{p,n}, engine.maximize);
|
Daniel@0
|
9 clpot{p} = multiply_by_pot(clpot{p}, seppot{p,n});
|
Daniel@0
|
10 end
|
Daniel@0
|
11 end
|
Daniel@0
|
12
|