wolffd@0: function [clpot, loglik] = enter_soft_evidence(engine, clique, potential, onodes, pot_type) wolffd@0: % ENTER_SOFT_EVIDENCE Add the specified potentials to the network (jtree) wolffd@0: % [clpot, loglik] = enter_soft_evidence(engine, clique, potential, onodes, pot_type, maximize) wolffd@0: % wolffd@0: % We multiply potential{i} onto clique(i) before propagating. wolffd@0: % We return all the modified clique potentials. wolffd@0: wolffd@0: % only used by BK! wolffd@0: wolffd@0: [clpot, seppot] = init_pot(engine, clique, potential, pot_type, onodes); wolffd@0: [clpot, seppot] = collect_evidence(engine, clpot, seppot); wolffd@0: [clpot, seppot] = distribute_evidence(engine, clpot, seppot); wolffd@0: wolffd@0: C = length(clpot); wolffd@0: ll = zeros(1, C); wolffd@0: for i=1:C wolffd@0: [clpot{i}, ll(i)] = normalize_pot(clpot{i}); wolffd@0: end wolffd@0: loglik = ll(1); % we can extract the likelihood from any clique wolffd@0: wolffd@0: