about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/BNT/potentials/@dpot/normalize_pot.m
blob: 1bc43cdb0474794d88de17665f867555a044ed3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
function [pot, loglik] = normalize_pot(pot)
% NORMALIZE_POT Convert the discrete potential Pr(X,E) into Pr(X|E) and return log Pr(E).
% [pot, loglik] = normalize_pot(pot)

if isempty(pot.T)  %add to process sparse
   loglik = 0;
   return;
end
[pot.T, lik] = normalise(pot.T);
loglik = log(lik + (lik==0)*eps);