check_for_cd_arcs.m

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

M
24
字号
function check_for_cd_arcs(onodes, cnodes, dag)% CHECK_FOR_CD_ARCS Raise an error if there are any C->D links where the C node is hidden.% check_for_cd_arcs(onodes, cnodes, dag)%% We cannot convert the logistic/softmax function (C->D CPD) to a Gaussian potential% unless we use the variational approximation discussed in % "A variational approximation for Bayesian networks with discrete and continuous latent% variables", K. Murphy, UAI 1999.n = length(dag);hnodes = mysetdiff(1:n, onodes);chid = myintersect(cnodes, hnodes);dnodes = mysetdiff(1:n, cnodes);for i=chid(:)'  dcs = myintersect(children(dag, i), dnodes);  if ~isempty(dcs)    error(['hidden cts node ' num2str(i) ' has a discrete child']);  endend

⌨️ 快捷键说明

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