shrink_obs_dims_in_table.m
来自「麻省理工学院的人工智能工具箱,很珍贵,希望对大家有用!」· M 代码 · 共 16 行
M
16 行
function T2 = shrink_obs_dims_in_table(T1, dom, evidence)% SHRINK_OBS_DIMS_IN_TABLE Set observed dimensions to size 1% T2 = shrink_obs_dims_in_table(T1, dom, evidence)%% If 'T1' contains observed nodes, it will have 0s in the positions that are% inconsistent with the evidence. We now remove these 0s and set the corresponding dimensions to% size 1, to be consistent with the way most inference engines handle evidence, which is to% shrink observed nodes before doing inference.% This is used by pearl and enumerative inf. engines.odom = dom(~isemptycell(evidence(dom)));vals = cat(1,evidence{odom});ndx = mk_multi_index(length(dom), find_equiv_posns(odom, dom), vals(:));T2 = T1(ndx{:});
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?