wolffd@0: % Compare the speeds of various inference engines on the water DBN wolffd@0: wolffd@0: [bnet, onodes] = mk_water_dbn; wolffd@0: wolffd@0: T = 3; wolffd@0: wolffd@0: engine = {}; wolffd@0: engine{end+1} = jtree_unrolled_dbn_inf_engine(bnet, T, onodes); wolffd@0: engine{end+1} = hmm_inf_engine(bnet, onodes); wolffd@0: engine{end+1} = frontier_inf_engine(bnet, onodes); wolffd@0: engine{end+1} = jtree_dbn_inf_engine(bnet, onodes); wolffd@0: engine{end+1} = bk_inf_engine(bnet, 'exact', onodes); wolffd@0: wolffd@0: engine{end+1} = bk_inf_engine(bnet, 'ff', onodes); wolffd@0: engine{end+1} = bk_inf_engine(bnet, { [1 2], [3 4 5 6], [7 8] }, onodes); wolffd@0: wolffd@0: N = length(engine); wolffd@0: exact = 1:5; wolffd@0: wolffd@0: wolffd@0: filter = 0; wolffd@0: err = cmp_inference(bnet, onodes, engine, exact, T, filter); wolffd@0: wolffd@0: % elapsed times for enter_evidence (matlab 5.3 on PIII with 256MB running Redhat linux) wolffd@0: wolffd@0: % T = 5, 4/20/00 wolffd@0: % 0.6266 unrolled * wolffd@0: % 0.3490 hmm * wolffd@0: % 1.1743 frontier wolffd@0: % 1.4621 old frontier wolffd@0: % 0.3270 fast frontier * wolffd@0: % 1.3926 jtree wolffd@0: % 1.3790 bk wolffd@0: % 0.4916 fast bk wolffd@0: % 0.4190 fast bk compiled wolffd@0: % 0.3574 fast jtree * wolffd@0: wolffd@0: wolffd@0: err = cmp_learning(bnet, onodes, engine, exact, T); wolffd@0: wolffd@0: % elapsed times for learn_params_dbn_em (matlab 5.3 on PIII with 256MB running Redhat linux) wolffd@0: wolffd@0: % T = 5, 2cases, 2 iter, 4/20/00 wolffd@0: % 3.5750 unrolled wolffd@0: % 3.7475 hmm wolffd@0: % 2.1452 fast frontier wolffd@0: % 2.5724 fast bk compiled wolffd@0: % 2.3387 fast jtree