?? cpd_to_scgpot.m
字號:
function pot = CPD_to_scgpot(CPD, domain, ns, cnodes, evidence)
% CPD_TO_SCGPOT Convert a CPD to a CG potential, incorporating any evidence (discrete)
% pot = CPD_to_scgpot(CPD, domain, ns, cnodes, evidence)
%
% domain is the domain of CPD.
% node_sizes(i) is the size of node i.
% cnodes
% evidence{i} is the evidence on the i'th node.
%odom = domain(~isemptycell(evidence(domain)));
%vals = cat(1, evidence{odom});
%map = find_equiv_posns(odom, domain);
%index = mk_multi_index(length(domain), map, vals);
CPT = CPD_to_CPT(CPD);
%CPT = CPT(index{:});
CPT = CPT(:);
%ns(odom) = 1;
potarray = cell(1, length(CPT));
for i=1:length(CPT)
%p = CPT(i);
potarray{i} = scgcpot(0, 0, CPT(i));
%scpot{i} = scpot(0, 0);
end
pot = scgpot(domain, [], [], ns, potarray);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -