annotate toolboxes/FullBNT-1.0.7/bnt/examples/dynamic/Old/chmm1.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 % Compare the speeds of various inference engines on a coupled HMM
wolffd@0 2
wolffd@0 3 N = 2;
wolffd@0 4 Q = 2;
wolffd@0 5 rand('state', 0);
wolffd@0 6 randn('state', 0);
wolffd@0 7 discrete = 1;
wolffd@0 8 if discrete
wolffd@0 9 Y = 2; % size of output alphabet
wolffd@0 10 else
wolffd@0 11 Y = 1;
wolffd@0 12 end
wolffd@0 13 coupled = 1;
wolffd@0 14 [bnet, onodes] = mk_chmm(N, Q, Y, discrete, coupled);
wolffd@0 15 ss = N*2;
wolffd@0 16
wolffd@0 17 T = 3;
wolffd@0 18
wolffd@0 19
wolffd@0 20 engine = {};
wolffd@0 21 tic; engine{end+1} = jtree_dbn_inf_engine(bnet, 'observed', onodes); toc
wolffd@0 22 %tic; engine{end+1} = jtree_ndxSD_dbn_inf_engine(bnet, onodes); toc
wolffd@0 23 %tic; engine{end+1} = jtree_ndxB_dbn_inf_engine(bnet, onodes); toc
wolffd@0 24 engine{end+1} = hmm_inf_engine(bnet, onodes);
wolffd@0 25 %engine{end+1} = dhmm_inf_engine(bnet, onodes);
wolffd@0 26 tic; engine{end+1} = jtree_unrolled_dbn_inf_engine(bnet, T, onodes); toc
wolffd@0 27
wolffd@0 28 %engine{end+1} = bk_inf_engine(bnet, 'ff', onodes);
wolffd@0 29 %engine{end+1} = loopy_dbn_inf_engine(bnet, onodes);
wolffd@0 30
wolffd@0 31 exact = [1 2 3];
wolffd@0 32
wolffd@0 33 filter = 0;
wolffd@0 34 single = 0;
wolffd@0 35 maximize = 0;
wolffd@0 36
wolffd@0 37 [err, time, engine] = cmp_inference(bnet, onodes, engine, exact, T, filter, single, maximize);
wolffd@0 38 %err = cmp_learning(bnet, onodes, engine, exact, T);
wolffd@0 39
wolffd@0 40