about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/BNT/inference/static/@belprop_mrf2_inf_engine/find_mpe.m
blob: fbd91265c7a253f8005eefa52e34f173ff107e4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
function mpe = find_mpe(engine, local_evidence)
% FIND_MPE Find the most probable explanation of the data  
% function mpe = find_mpe(engine, local_evidence
%
% local_evidence{i}(j) = Pr(observation at node i | S(i)=j)
%
% This finds the marginally most likely value for each hidden node.
% It may give inconsistent results if there are ties.

[mpe, niter] = bp_mpe_mrf2(engine.mrf2.adj_mat, engine.mrf2.pot, local_evidence, ...
			   'max_iter', engine.max_iter, 'momentum', engine.momentum, ...
			   'tol', engine.tol);