Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Denkowski <mdenkows@amazon.com>2015-09-25 12:03:23 +0300
committerMichael Denkowski <mdenkows@amazon.com>2015-09-25 12:03:23 +0300
commit56e3bc1ea209540bc0ade9797e6dfba578738e1d (patch)
treea3594bc0cd9783e3d109f374a9e20b323e736a5e /moses/HypothesisStackCubePruning.cpp
parentd2a6aa752e91ce62bd746a704b1a7e7534fdbb59 (diff)
Reintroduce deterministic cube pruning as option
Use --cube-pruning-deterministic-search or --cbds
Diffstat (limited to 'moses/HypothesisStackCubePruning.cpp')
-rw-r--r--moses/HypothesisStackCubePruning.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/moses/HypothesisStackCubePruning.cpp b/moses/HypothesisStackCubePruning.cpp
index 23fc2b01a..ff8b0dafb 100644
--- a/moses/HypothesisStackCubePruning.cpp
+++ b/moses/HypothesisStackCubePruning.cpp
@@ -39,6 +39,7 @@ HypothesisStackCubePruning::HypothesisStackCubePruning(Manager& manager) :
m_nBestIsEnabled = StaticData::Instance().options().nbest.enabled;
m_bestScore = -std::numeric_limits<float>::infinity();
m_worstScore = -std::numeric_limits<float>::infinity();
+ m_deterministic = manager.options().cube.deterministic_search;
}
/** remove all hypotheses from the collection */
@@ -148,7 +149,7 @@ void HypothesisStackCubePruning::AddInitial(Hypothesis *hypo)
"Should have added hypothesis " << *hypo);
const WordsBitmap &bitmap = hypo->GetWordsBitmap();
- m_bitmapAccessor[bitmap] = new BitmapContainer(bitmap, *this);
+ m_bitmapAccessor[bitmap] = new BitmapContainer(bitmap, *this, m_deterministic);
}
void HypothesisStackCubePruning::PruneToSize(size_t newSize)
@@ -258,7 +259,7 @@ void HypothesisStackCubePruning::SetBitmapAccessor(const WordsBitmap &newBitmap
BitmapContainer *bmContainer;
if (bcExists == m_bitmapAccessor.end()) {
- bmContainer = new BitmapContainer(newBitmap, stack);
+ bmContainer = new BitmapContainer(newBitmap, stack, m_deterministic);
m_bitmapAccessor[newBitmap] = bmContainer;
} else {
bmContainer = bcExists->second;