?? enter_evidence.m
字號:
function [engine, loglik] = enter_evidence(engine, evidence, varargin)% ENTER_EVIDENCE Add the specified evidence to the network (global_joint)% [engine, loglik] = enter_evidence(engine, evidence, ...)%% evidence{i} = [] if if X(i) is hidden, and otherwise contains its observed value.%% Warning: Computing the log likelihood requires marginalizing all the nodes and can be slow.%% The list below gives optional arguments [default value in brackets]. %% exclude - list of nodes whose potential will not be included in the joint [ [] ]%% e.g., engine = enter_evidence(engine, ev, 'exclude', 3)exclude = [];if nargin >= 3 args = varargin; nargs = length(args); for i=1:2:nargs switch args{i}, case 'exclude', exclude = args{i+1}; otherwise, error(['invalid argument name ' args{i}]); end endend bnet = bnet_from_engine(engine);N = length(bnet.node_sizes);engine.jpot = compute_joint_pot(bnet, mysetdiff(1:N, exclude), evidence, 1:N);if nargout == 2 [m, loglik] = marginal_nodes(engine, []);end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -