annotate toolboxes/FullBNT-1.0.7/bnt/inference/static/@belprop_mrf2_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 [engine, ll, niter] = enter_soft_evidence(engine, local_evidence)
|
wolffd@0
|
2 % ENTER_SOFT_EVIDENCE Propagate evidence using belief propagation
|
wolffd@0
|
3 % [engine, ll, niter] = enter_soft_evidence(engine, local_evidence)
|
wolffd@0
|
4 %
|
wolffd@0
|
5 % local_evidence{i}(j) = Pr(observation at node i | S(i)=j)
|
wolffd@0
|
6 %
|
wolffd@0
|
7 % The log-likelihood is not computed; ll = 0.
|
wolffd@0
|
8 % niter contains the number of iterations used
|
wolffd@0
|
9
|
wolffd@0
|
10 ll = 0;
|
wolffd@0
|
11 mrf2 = engine.mrf2;
|
wolffd@0
|
12 [bel, niter] = bp_mrf2(mrf2.adj_mat, mrf2.pot, local_evidence, ...
|
wolffd@0
|
13 'max_iter', engine.max_iter, 'momentum', engine.momentum, ...
|
wolffd@0
|
14 'tol', engine.tol, 'maximize', 0, 'verbose', engine.verbose);
|
wolffd@0
|
15 engine.bel = bel;
|