Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/examples/static/Belprop/belprop_loopy_cg.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 % Same as cg1, except we assume all discretes are observed, | |
2 % and use loopy for approximate inference. | |
3 | |
4 ns = 2*ones(1,9); | |
5 F = 1; W = 2; E = 3; B = 4; C = 5; D = 6; Min = 7; Mout = 8; L = 9; | |
6 n = 9; | |
7 dnodes = [B F W]; | |
8 cnodes = mysetdiff(1:n, dnodes); | |
9 | |
10 %bnet = mk_incinerator_bnet(ns); | |
11 bnet = mk_incinerator_bnet; | |
12 | |
13 bnet.observed = [dnodes E]; | |
14 | |
15 engines = {}; | |
16 engines{end+1} = jtree_inf_engine(bnet); | |
17 engines{end+1} = pearl_inf_engine(bnet, 'protocol', 'parallel'); | |
18 nengines = length(engines); | |
19 | |
20 | |
21 [time, engines] = cmp_inference_static(bnet, engines, 'maximize', 0, 'check_ll', 0, ... | |
22 'singletons_only', 0, 'exact', 1, 'check_converged', 2); |