⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpd_to_scgpot.m

📁 贝叶斯算法(matlab编写) 安装,添加目录 /home/ai2/murphyk/matlab/FullBNT
💻 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 + -