From 31d21ec50cb9689a73ee58617d282741396ca510 Mon Sep 17 00:00:00 2001 From: graehl Date: Fri, 9 Jul 2010 15:12:46 +0000 Subject: exhaustive rather than cube, if ModelSet is stateless git-svn-id: https://ws10smt.googlecode.com/svn/trunk@195 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/apply_models.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/decoder/apply_models.cc b/decoder/apply_models.cc index 0b667de0..78f37e68 100644 --- a/decoder/apply_models.cc +++ b/decoder/apply_models.cc @@ -408,18 +408,17 @@ void ApplyModelSet(const Hypergraph& in, const ModelSet& models, const IntersectionConfiguration& config, Hypergraph* out) { - // TODO special handling when all models are stateless - if (config.algorithm == 1) { + if (models.stateless() && config.algorithm == 0) { + NoPruningRescorer ma(models, smeta, in, out); // avoid overhead of best-first when no state + ma.Apply(); + } else if (config.algorithm == 1) { int pl = config.pop_limit; if (pl > 100 && in.nodes_.size() > 80000) { - cerr << " Note: reducing pop_limit to " << pl << " for very large forest\n"; pl = 30; + cerr << " Note: reducing pop_limit to " << pl << " for very large forest\n"; } CubePruningRescorer ma(models, smeta, in, pl, out); ma.Apply(); - } else if (config.algorithm == 0) { - NoPruningRescorer ma(models, smeta, in, out); - ma.Apply(); } else { cerr << "Don't understand intersection algorithm " << config.algorithm << endl; exit(1); -- cgit v1.2.3