annotate toolboxes/FullBNT-1.0.7/bnt/examples/dynamic/mildew1.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 bnet = mk_mildew_dbn;
wolffd@0 2
wolffd@0 3 T = 4;
wolffd@0 4 engine = {};
wolffd@0 5 engine{end+1} = jtree_unrolled_dbn_inf_engine(bnet, T);
wolffd@0 6 engine{end+1} = jtree_dbn_inf_engine(bnet);
wolffd@0 7 %engine{end+1} = hmm_inf_engine(bnet); % 8 is observed but has kids
wolffd@0 8 engine{end+1} = smoother_engine(jtree_2TBN_inf_engine(bnet));
wolffd@0 9 %engine{end+1} = smoother_engine(hmm_2TBN_inf_engine(bnet));
wolffd@0 10
wolffd@0 11 inf_time = cmp_inference_dbn(bnet, engine, T, 'check_ll', 0)
wolffd@0 12 %learning_time = cmp_learning_dbn(bnet, engine, T)
wolffd@0 13
wolffd@0 14 S = struct(engine{1});
wolffd@0 15 S1 = struct(S.unrolled_engine);
wolffd@0 16 G = S1.jtree;
wolffd@0 17 %graph_to_dot(G, 'directed', 0, 'leftright', 1, ...
wolffd@0 18 % 'filename', '/home/eecs/murphyk/WP/Thesis/Figures/Inf/Mildew/jtree.dot')
wolffd@0 19 %!dot -Tps jtree.dot -o jtree.ps
wolffd@0 20 % The resulting ps file cannot be converted using ps2pdf.
wolffd@0 21
wolffd@0 22 N = length(G);
wolffd@0 23 for i=1:N
wolffd@0 24 for j=1:N
wolffd@0 25 if G(i,j)
wolffd@0 26 G(j,i)=1;
wolffd@0 27 end
wolffd@0 28 end
wolffd@0 29 end
wolffd@0 30 draw_graph(G)