comparison toolboxes/FullBNT-1.0.7/bnt/examples/dynamic/bat1.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 % Compare the speeds of various inference engines on the BAT DBN
2 [bnet, names] = mk_bat_dbn;
3
4 T = 3; % fixed length sequence - we make it short just for speed
5
6 USEC = exist('@jtree_C_inf_engine/collect_evidence','file');
7
8 disp('constructing engines for BAT');
9 engine = {}; % time in seconds for inference
10 engine{end+1} = jtree_unrolled_dbn_inf_engine(bnet, T, 'useC', USEC); % 0.39
11 engine{end+1} = smoother_engine(jtree_2TBN_inf_engine(bnet)); % 4.89
12 engine{end+1} = jtree_dbn_inf_engine(bnet); % 4.45
13 if 0
14 engine{end+1} = jtree_ndx_dbn_inf_engine(bnet, 'ndx_type', 'SD'); % 2.98
15 engine{end+1} = jtree_ndx_dbn_inf_engine(bnet, 'ndx_type', 'D'); % 3.52
16 engine{end+1} = jtree_ndx_dbn_inf_engine(bnet, 'ndx_type', 'B'); % 2.40
17 if USEC, engine{end+1} = jtree_C_dbn_inf_engine(bnet); end % 3.54
18 %engine{end+1} = hmm_inf_engine(bnet, onodes); % too big
19 end
20
21 %tic; engine{end+1} = frontier_inf_engine(bnet); toc % very slow
22 % The frontier engine thrashes badly on the BAT network
23 %tic; engine{end+1} = bk_inf_engine(bnet, 'exact', onodes); toc % SLOW!
24
25 %tic; engine{end+1} = bk_inf_engine(bnet, 'ff', onodes); toc
26
27 %clusters{1} = [stringmatch({'LeftClr', 'RightClr', 'LatAct', 'Xdot', 'InLane'}, names)];
28 %clusters{2} = [stringmatch({'FwdAct', 'Ydot', 'Stopped', 'EngStatus', 'FBStatus'}, names)];
29
30 %tic; engine{end+1} = bk_inf_engine(bnet, clusters, onodes); toc
31
32 disp('inference')
33 time = cmp_inference_dbn(bnet, engine, T)
34
35 disp('learning')
36 time = cmp_learning_dbn(bnet, engine, T)
37
38
39
40
41
42
43
44