亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pearl_inf_engine.m

?? Bayesian網絡工具箱.
?? M
字號:
function engine = pearl_inf_engine(bnet, varargin)
% PEARL_INF_ENGINE Pearl's algorithm (belief propagation)
% engine = pearl_inf_engine(bnet, ...)
%
% If the graph has no loops (undirected cycles), you should use the tree protocol,
% and the results will be exact.
% Otherwise, you should use the parallel protocol, and the results may be approximate.
%
% Optional arguments [default in brackets]
% 'protocol' - tree or parallel ['parallel']
%
% Optional arguments for the loopy case
% 'max_iter' - specifies the max num. iterations to perform [2*num nodes]
% 'tol' - convergence criterion on messages  [1e-3]
% 'momentum' - msg = (m*old + (1-m)*new). [m=0]
% 'filename' -  msgs will be printed to this file, so you can assess convergence while it runs [[]]
% 'storebel' - 1 means save engine.bel{n,t} for every iteration t and hidden node n [0]
%
% If there are discrete and cts nodes, we assume all the discretes are observed. In this
% case, you must use the parallel protocol, and the evidence pattern must be fixed.


N = length(bnet.dag);
protocol = [];
max_iter = 2*N;
% We use N+2 for the following reason:
% In N iterations, we get the exact answer for a tree.
% In the N+1st iteration, we notice that the results are the same as before, and terminate.
% In loopy_converged, we see that N+1 < max = N+2, and declare convergence.
tol = 1e-3;
momentum = 0;
filename = [];
storebel = 0;

args = varargin;
for i=1:2:length(args)
  switch args{i},
   case 'protocol', protocol = args{i+1};
   case 'max_iter', max_iter = args{i+1};
   case 'tol', tol = args{i+1};
   case 'momentum', momentum = args{i+1};
   case 'filename', filename = args{i+1};
   case 'storebel', storebel = args{i+1};
  end
end

engine.filename = filename;
engine.storebel = storebel;
engine.bel = [];

if strcmp(protocol, 'tree')
  % We first send messages up to the root (pivot node), and then back towards the leaves.
  % If the bnet is a singly connected graph (no loops), choosing a root induces a directed tree.
  % Peot and Shachter discuss ways to pick the root so as to minimize the work,
  % taking into account which nodes have changed.
  % For simplicity, we always pick the root to be the last node in the graph.
  % This means the first pass is equivalent to going forward in time in a DBN.

  engine.root = N;
  [engine.adj_mat, engine.preorder, engine.postorder, engine.heights, loopy] = ...
    mk_rooted_tree(bnet.dag, engine.root);
  % engine.adj_mat might have different edge orientations from bnet.dag
  if loopy
    error('can only apply tree protocol to loop-less graphs')
  end
else
  engine.root = [];
  engine.adj_mat = [];
  engine.preorder = [];
  engine.postorder = [];
  engine.heights = [];
end

engine.niter = [];
engine.protocol = protocol;
engine.max_iter = max_iter;
engine.tol = tol;
engine.momentum = momentum;
engine.maximize = [];

%onodes = find(~isemptycell(evidence));
onodes = bnet.observed;
engine.msg_type = determine_pot_type(bnet, onodes, 1:N); % needed also by marginal_nodes
if strcmp(engine.msg_type, 'cg')
  error('messages must be discrete or Gaussian')
end
[engine.msg_dag, disconnected_nodes] = mk_msg_dag(bnet, engine.msg_type, onodes);
engine.disconnected_nodes_bitv = zeros(1,N);
engine.disconnected_nodes_bitv(disconnected_nodes) = 1;


% this is where we store stuff between enter_evidence and marginal_nodes
engine.marginal = cell(1,N);
engine.evidence = []; 
engine.msg = [];

[engine.parent_index, engine.child_index] = mk_loopy_msg_indices(engine.msg_dag);

engine = class(engine, 'pearl_inf_engine', inf_engine(bnet));
 

%%%%%%%%%

function [dag, disconnected_nodes] = mk_msg_dag(bnet, msg_type, onodes)

% If we are using Gaussian msgs, all discrete nodes must be observed;
% they are then disconnected from the graph, so we don't try to send
% msgs to/from them: their observed value simply serves to index into
% the right set of parameters for the Gaussian nodes (which use CPD.ps
% instead of parents(dag), and hence are unaffected by this "surgery").

disconnected_nodes = [];
switch msg_type
 case 'd', dag = bnet.dag;
 case 'g',
  disconnected_nodes = bnet.dnodes;
  dag = bnet.dag;
  for i=disconnected_nodes(:)'
    ps = parents(bnet.dag, i);
    cs = children(bnet.dag, i);
    if ~isempty(ps), dag(ps, i) = 0; end
    if ~isempty(cs), dag(i, cs) = 0; end
  end
end


%%%%%%%%%%
function [parent_index, child_index] = mk_loopy_msg_indices(dag)
% MK_LOOPY_MSG_INDICES Compute "port numbers" for message passing
% [parent_index, child_index] = mk_loopy_msg_indices(bnet)
%
% child_index{n}(c) = i means c is n's i'th child, i.e., i = find_equiv_posns(c, children(n))
% child_index{n}(c) = 0 means c is not a child of n.
% parent_index{n}{p} is defined similarly.
% We need to use these indices since the pi_from_parent/ lambda_from_child cell arrays
% cannot be sparse, and hence cannot be indexed by the actual number of the node.
% Instead, we use the number of the "port" on which the message arrived.

N = length(dag);
child_index = cell(1,N);
parent_index = cell(1,N);
for n=1:N
  cs = children(dag, n);
  child_index{n} = sparse(1,N);
  for i=1:length(cs)
    c = cs(i);
    child_index{n}(c) = i;
  end
  ps = parents(dag, n);
  parent_index{n} = sparse(1,N);
  for i=1:length(ps)
    p = ps(i);
    parent_index{n}(p) = i;
  end
end




?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产女人aaa级久久久级| 午夜欧美2019年伦理| 亚洲激情中文1区| 久久精品噜噜噜成人88aⅴ| 成人激情免费电影网址| 日韩欧美国产综合在线一区二区三区| 久久女同互慰一区二区三区| 性久久久久久久久| 91片在线免费观看| 国产片一区二区| 美女尤物国产一区| 欧美色欧美亚洲另类二区| 国产精品久久久久久久久图文区| 黄色精品一二区| 欧美片在线播放| 亚洲国产一区二区在线播放| av在线不卡电影| 国产精品乱码久久久久久| 国产一区二区在线电影| 欧美一区2区视频在线观看| 一区二区三区四区在线播放| 成av人片一区二区| 中文字幕欧美区| 丁香啪啪综合成人亚洲小说| 精品国产91乱码一区二区三区| 亚洲国产一区二区三区| 欧美日韩久久一区| 亚洲午夜激情网页| 欧美日韩一区二区欧美激情| 精品一区二区在线视频| 这里只有精品视频在线观看| 午夜精品久久久久久久久久| 欧美视频三区在线播放| 一区二区三区四区中文字幕| 欧美性xxxxxx少妇| 亚洲午夜精品在线| 777奇米四色成人影色区| 日本成人中文字幕| 日韩免费看的电影| 久久精品二区亚洲w码| 精品久久国产字幕高潮| 精品一区二区三区在线观看| 久久综合九色综合久久久精品综合| 秋霞国产午夜精品免费视频 | 天天av天天翘天天综合网| 91久久线看在观草草青青| 一区二区在线观看视频| 欧美日韩精品一区二区天天拍小说| 日韩中文字幕1| 精品欧美乱码久久久久久| 国产乱码精品一区二区三区忘忧草 | 不卡一区在线观看| 日韩毛片一二三区| 欧美视频一区二区三区在线观看| 午夜国产精品一区| 国产亚洲欧美一级| 99久久精品免费| 亚洲综合一区二区| 欧美xxxx老人做受| 成人亚洲精品久久久久软件| 亚洲色图色小说| 91精品国产综合久久精品图片 | 亚洲国产综合色| 欧美xxxx老人做受| 91麻豆文化传媒在线观看| 免费看日韩a级影片| 国产精品色眯眯| 91精品国产综合久久小美女| 懂色av噜噜一区二区三区av| 亚洲午夜久久久久| 欧美国产欧美综合| 51久久夜色精品国产麻豆| 国产一区久久久| 亚洲小说欧美激情另类| 国产午夜精品久久| 欧美人伦禁忌dvd放荡欲情| 成人深夜在线观看| 日本aⅴ精品一区二区三区| 国产精品毛片无遮挡高清| 欧美一区二区三区思思人| 91一区二区在线观看| 黄一区二区三区| 亚洲一区二区三区不卡国产欧美| 久久久久久久久久久电影| 欧美高清视频不卡网| 成人国产一区二区三区精品| 蜜桃av噜噜一区二区三区小说| 亚洲日本在线观看| 久久久不卡网国产精品二区| 欧美一卡二卡三卡| 欧美日韩在线三级| 97久久精品人人做人人爽| 极品美女销魂一区二区三区免费| 亚洲一二三区在线观看| 亚洲免费观看高清| 国产亚洲精品超碰| 精品蜜桃在线看| 欧美一区二区三区在线| 欧美亚洲免费在线一区| 成人黄色在线网站| 国产成人久久精品77777最新版本| 免费成人在线影院| 午夜久久久影院| 一区二区三区中文字幕| 国产精品成人午夜| 国产欧美一区二区在线观看| 精品99999| 精品久久人人做人人爰| 日韩三级av在线播放| 欧美精品xxxxbbbb| 91精品国产综合久久久久久久 | 在线欧美一区二区| 色综合久久久久久久久久久| av毛片久久久久**hd| 成人av第一页| 99久久精品国产一区二区三区| 国产成人精品一区二区三区四区| 国产麻豆精品视频| 欧美色欧美亚洲另类二区| 日本韩国精品在线| 日本高清不卡aⅴ免费网站| 欧美色欧美亚洲另类二区| 欧美日韩在线亚洲一区蜜芽| 91精品国产综合久久久久久久 | 国产福利一区二区三区在线视频| 国产一区二三区| 成人黄色av电影| 91丨九色porny丨蝌蚪| 色悠悠久久综合| 欧美影视一区二区三区| 欧美一区二视频| 国产欧美精品一区二区色综合 | 91福利国产成人精品照片| 91免费观看视频在线| 色诱视频网站一区| 欧美裸体bbwbbwbbw| 精品少妇一区二区三区免费观看| 国产色产综合产在线视频| 国产精品乱子久久久久| 一区二区三区精品| 热久久免费视频| 成人性视频网站| 欧美亚洲国产一区在线观看网站| 欧美岛国在线观看| 久久蜜桃一区二区| 亚洲色图视频免费播放| 五月天久久比比资源色| 国产精品一区在线观看乱码| 91网站在线观看视频| 日韩精品中午字幕| 中文字幕制服丝袜一区二区三区 | 在线免费亚洲电影| 国产精品久久久久久久久快鸭| 亚洲最快最全在线视频| 极品少妇xxxx偷拍精品少妇| 99久久综合国产精品| 欧美一区二区三区成人| 国产精品久久午夜| 奇米色一区二区| 99re在线视频这里只有精品| 欧美一区二区视频免费观看| 日韩理论电影院| 国产一区二区免费看| 欧美日韩你懂的| 国产精品伦一区二区三级视频| 日韩不卡手机在线v区| 91麻豆视频网站| 国产日韩欧美不卡在线| 日韩电影在线观看一区| 色www精品视频在线观看| 国产午夜久久久久| 免费在线观看日韩欧美| 91一区二区在线| 久久精品水蜜桃av综合天堂| 人人爽香蕉精品| 欧美性生交片4| 中文字幕在线一区免费| 国产精品88888| 日韩欧美的一区| 五月天一区二区| 色老头久久综合| 国产精品第四页| 风间由美性色一区二区三区| 久久亚洲免费视频| 水蜜桃久久夜色精品一区的特点| 在线视频你懂得一区二区三区| 国产精品久久久久7777按摩| 国产精品一区二区果冻传媒| 日韩欧美高清在线| 免费成人在线播放| 中文字幕精品在线不卡| 国产乱码精品一区二区三区五月婷 | 国产精品久久久久久久岛一牛影视| 久草精品在线观看| 精品伦理精品一区| 久久国产欧美日韩精品| 精品乱人伦小说| 国产一二精品视频| 亚洲国产精品国自产拍av| 成人高清视频在线观看|