convert_dbn_cpds_to_pots.m

来自「麻省理工学院的人工智能工具箱,很珍贵,希望对大家有用!」· M 代码 · 共 24 行

M
24
字号
function CPDpot = convert_dbn_CPDs_to_pots(bnet, evidence, pot_type)% CONVERT_DBN_CPDS_TO_POTS Convert CPDs of (possibly instantiated) DBN nodes to potentials% CPDpot = convert_dbn_CPDs_to_pots(bnet, evidence, pot_type)%% CPDpot{n,t} is a potential containing P(n,t|pa(n,t), ev)[ss T] = size(evidence);% Convert CPDs of instantiated nodes to potential formCPDpot = cell(ss,T);      t = 1;for n=1:ss  fam = family(bnet.dag, n);  e = bnet.equiv_class(n, 1);  CPDpot{n,t} = convert_to_pot(bnet.CPD{e}, pot_type, fam(:), evidence(:,1));endfor n=1:ss  fam = family(bnet.dag, n, 2);  e = bnet.equiv_class(n, 2);  for t=2:T    CPDpot{n,t} = convert_to_pot(bnet.CPD{e}, pot_type, fam(:), evidence(:,t-1:t));  endend       

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?