diff options
author | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2007-11-12 23:21:44 +0300 |
---|---|---|
committer | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2007-11-12 23:21:44 +0300 |
commit | 2672b8cb34c8f990fd7568adbd8570af6a03c997 (patch) | |
tree | 7a79e05ab2a4701c08e1d519835764344cea67e7 /moses | |
parent | 9521e78fbf72343670c49201418f4cc19b7ff299 (diff) |
variable renaming - less confusing & to make it comparable to async branch
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1511 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'moses')
-rwxr-xr-x | moses/src/HypothesisStack.cpp | 8 | ||||
-rwxr-xr-x | moses/src/HypothesisStack.h | 8 | ||||
-rwxr-xr-x | moses/src/Manager.cpp | 2 | ||||
-rwxr-xr-x | moses/src/StaticData.cpp | 4 | ||||
-rwxr-xr-x | moses/src/StaticData.h | 6 | ||||
-rwxr-xr-x | moses/src/TypeDef.h | 2 |
6 files changed, 15 insertions, 15 deletions
diff --git a/moses/src/HypothesisStack.cpp b/moses/src/HypothesisStack.cpp index e621bed5f..44dfd101f 100755 --- a/moses/src/HypothesisStack.cpp +++ b/moses/src/HypothesisStack.cpp @@ -58,8 +58,8 @@ pair<HypothesisStack::iterator, bool> HypothesisStack::Add(Hypothesis *hypo) VERBOSE(3,", best on stack"); m_bestScore = hypo->GetTotalScore(); // this may also affect the worst score - if ( m_bestScore + m_beamThreshold > m_worstScore ) - m_worstScore = m_bestScore + m_beamThreshold; + if ( m_bestScore + m_beamWidth > m_worstScore ) + m_worstScore = m_bestScore + m_beamWidth; } // Prune only if stack is twice as big as needed (lazy pruning) @@ -140,14 +140,14 @@ void HypothesisStack::PruneToSize(size_t newSize) priority_queue<float> bestScores; // push all scores to a heap - // (but never push scores below m_bestScore+m_beamThreshold) + // (but never push scores below m_bestScore+m_beamWidth) iterator iter = m_hypos.begin(); float score = 0; while (iter != m_hypos.end()) { Hypothesis *hypo = *iter; score = hypo->GetTotalScore(); - if (score > m_bestScore+m_beamThreshold) + if (score > m_bestScore+m_beamWidth) { bestScores.push(score); } diff --git a/moses/src/HypothesisStack.h b/moses/src/HypothesisStack.h index 2933f41e9..6132595e8 100755 --- a/moses/src/HypothesisStack.h +++ b/moses/src/HypothesisStack.h @@ -66,7 +66,7 @@ public: protected: float m_bestScore; /**< score of the best hypothesis in collection */ float m_worstScore; /**< score of the worse hypthesis in collection */ - float m_beamThreshold; /**< minimum score due to threashold pruning */ + float m_beamWidth; /**< minimum score due to threashold pruning */ size_t m_maxHypoStackSize; /**< maximum number of hypothesis allowed in this stack */ _HCType m_hypos; /**< contains hypotheses */ bool m_nBestIsEnabled; /**< flag to determine whether to keep track of old arcs */ @@ -123,9 +123,9 @@ public: * this factor times the best score to be allowed in the stack * \param beamThreshold minimum factor (typical number: 0.03) */ - inline void SetBeamThreshold(float beamThreshold) + inline void SetBeamWidth(float beamWidth) { - m_beamThreshold = beamThreshold; + m_beamWidth = beamWidth; } /** return score of the best hypothesis in the stack */ inline float GetBestScore() const @@ -137,7 +137,7 @@ public: * Pruning algorithm: find a threshold and delete all hypothesis below it. * The threshold is chosen so that exactly newSize top items remain on the * stack in fact, in situations where some of the hypothesis fell below - * m_beamThreshold, the stack will contain less items. + * m_beamWidth, the stack will contain less items. * \param newSize maximum size */ void PruneToSize(size_t newSize); diff --git a/moses/src/Manager.cpp b/moses/src/Manager.cpp index 479292474..42ada55bb 100755 --- a/moses/src/Manager.cpp +++ b/moses/src/Manager.cpp @@ -60,7 +60,7 @@ Manager::Manager(InputType const& source) { HypothesisStack &sourceHypoColl = *iterStack; sourceHypoColl.SetMaxHypoStackSize(staticData.GetMaxHypoStackSize()); - sourceHypoColl.SetBeamThreshold(staticData.GetBeamThreshold()); + sourceHypoColl.SetBeamWidth(staticData.GetBeamWidth()); } } diff --git a/moses/src/StaticData.cpp b/moses/src/StaticData.cpp index 369f49cdf..8f52ab366 100755 --- a/moses/src/StaticData.cpp +++ b/moses/src/StaticData.cpp @@ -217,9 +217,9 @@ bool StaticData::LoadData(Parameter *parameter) m_useDistortionFutureCosts = (m_parameter->GetParam("use-distortion-future-costs").size() > 0) ? Scan<bool>(m_parameter->GetParam("use-distortion-future-costs")[0]) : false; - m_beamThreshold = (m_parameter->GetParam("beam-threshold").size() > 0) ? + m_beamWidth = (m_parameter->GetParam("beam-threshold").size() > 0) ? TransformScore(Scan<float>(m_parameter->GetParam("beam-threshold")[0])) - : TransformScore(DEFAULT_BEAM_THRESHOLD); + : TransformScore(DEFAULT_BEAM_WIDTH); m_maxNoTransOptPerCoverage = (m_parameter->GetParam("max-trans-opt-per-coverage").size() > 0) ? Scan<size_t>(m_parameter->GetParam("max-trans-opt-per-coverage")[0]) : DEFAULT_MAX_TRANS_OPT_SIZE; diff --git a/moses/src/StaticData.h b/moses/src/StaticData.h index 25a3938d6..9486ac07b 100755 --- a/moses/src/StaticData.h +++ b/moses/src/StaticData.h @@ -62,7 +62,7 @@ protected: // Initial = 0 = can be used when creating poss trans // Other = 1 = used to calculate LM score once all steps have been processed float - m_beamThreshold, + m_beamWidth, m_weightDistortion, m_weightWordPenalty, m_wordDeletionWeight, @@ -243,9 +243,9 @@ public: { return m_maxDistortion; } - float GetBeamThreshold() const + float GetBeamWidth() const { - return m_beamThreshold; + return m_beamWidth; } //! returns the total number of score components across all types, all factors size_t GetTotalScoreComponents() const diff --git a/moses/src/TypeDef.h b/moses/src/TypeDef.h index d24ceab05..428d0eaac 100755 --- a/moses/src/TypeDef.h +++ b/moses/src/TypeDef.h @@ -46,7 +46,7 @@ const size_t DEFAULT_MAX_PART_TRANS_OPT_SIZE = 10000; const size_t DEFAULT_MAX_PHRASE_LENGTH = 20; const size_t ARRAY_SIZE_INCR = 10; //amount by which a phrase gets resized when necessary const float LOWEST_SCORE = -100.0f; -const float DEFAULT_BEAM_THRESHOLD = 0.00001f; +const float DEFAULT_BEAM_WIDTH = 0.00001f; const size_t DEFAULT_VERBOSE_LEVEL = 1; ///////////////////////////////////////////////// |