Consistent naming: m_futureScore --> m_estimatedScore

This commit is contained in:
Hieu Hoang 2015-11-09 12:23:43 +00:00
parent 09bf755305
commit 176573c072
2 changed files with 10 additions and 10 deletions

View File

@ -54,7 +54,7 @@ Hypothesis(Manager& manager, InputType const& source, const TranslationOption &i
, m_currTargetWordsRange(NOT_FOUND, NOT_FOUND)
, m_wordDeleted(false)
, m_totalScore(0.0f)
, m_futureScore(0.0f)
, m_estimatedScore(0.0f)
, m_ffStates(StatefulFeatureFunction::GetStatefulFeatureFunctions().size())
, m_arcList(NULL)
, m_transOpt(initialTransOpt)
@ -85,7 +85,7 @@ Hypothesis(const Hypothesis &prevHypo, const TranslationOption &transOpt, const
+ transOpt.GetTargetPhrase().GetSize())
, m_wordDeleted(false)
, m_totalScore(0.0f)
, m_futureScore(0.0f)
, m_estimatedScore(0.0f)
, m_ffStates(prevHypo.m_ffStates.size())
, m_arcList(NULL)
, m_transOpt(transOpt)
@ -206,10 +206,10 @@ EvaluateWhenApplied(float futureScore)
}
// FUTURE COST
m_futureScore = futureScore;
m_estimatedScore = futureScore;
// TOTAL
m_totalScore = m_currScoreBreakdown.GetWeightedScore() + m_futureScore;
m_totalScore = m_currScoreBreakdown.GetWeightedScore() + m_estimatedScore;
if (m_prevHypo) m_totalScore += m_prevHypo->GetScore();
IFVERBOSE(2) {
@ -247,7 +247,7 @@ PrintHypothesis() const
TRACE_ERR( m_prevHypo->GetCurrTargetPhrase().GetSubString(range) << " ");
}
TRACE_ERR( ")"<<endl);
TRACE_ERR( "\tbase score "<< (m_prevHypo->m_totalScore - m_prevHypo->m_futureScore) <<endl);
TRACE_ERR( "\tbase score "<< (m_prevHypo->m_totalScore - m_prevHypo->m_estimatedScore) <<endl);
TRACE_ERR( "\tcovering "<<m_currSourceWordsRange.GetStartPos()<<"-"<<m_currSourceWordsRange.GetEndPos()
<<": " << m_transOpt.GetInputPath().GetPhrase() << endl);
@ -257,7 +257,7 @@ PrintHypothesis() const
// TRACE_ERR( "\tdistance: "<<GetCurrSourceWordsRange().CalcDistortion(m_prevHypo->GetCurrSourceWordsRange())); // << " => distortion cost "<<(m_score[ScoreType::Distortion]*weightDistortion)<<endl;
// TRACE_ERR( "\tlanguage model cost "); // <<m_score[ScoreType::LanguageModelScore]<<endl;
// TRACE_ERR( "\tword penalty "); // <<(m_score[ScoreType::WordPenalty]*weightWordPenalty)<<endl;
TRACE_ERR( "\tscore "<<m_totalScore - m_futureScore<<" + future cost "<<m_futureScore<<" = "<<m_totalScore<<endl);
TRACE_ERR( "\tscore "<<m_totalScore - m_estimatedScore<<" + future cost "<<m_estimatedScore<<" = "<<m_totalScore<<endl);
TRACE_ERR( "\tunweighted feature scores: " << m_currScoreBreakdown << endl);
//PrintLMScores();
}
@ -609,8 +609,8 @@ beats(Hypothesis const& b) const
{
if (m_totalScore != b.m_totalScore)
return m_totalScore > b.m_totalScore;
else if (m_futureScore != b.m_futureScore)
return m_futureScore > b.m_futureScore;
else if (m_estimatedScore != b.m_estimatedScore)
return m_estimatedScore > b.m_estimatedScore;
else if (m_prevHypo)
return b.m_prevHypo ? m_prevHypo->beats(*b.m_prevHypo) : true;
else return false;

View File

@ -72,7 +72,7 @@ protected:
Range m_currTargetWordsRange; /*! target word positions of the last phrase that was used to create this hypothesis */
bool m_wordDeleted;
float m_totalScore; /*! score so far */
float m_futureScore; /*! estimated future cost to translate rest of sentence */
float m_estimatedScore; /*! estimated future cost to translate rest of sentence */
/*! sum of scores of this hypothesis, and previous hypotheses. Lazily initialised. */
mutable boost::scoped_ptr<ScoreComponentCollection> m_scoreBreakdown;
ScoreComponentCollection m_currScoreBreakdown; /*! scores for this hypothesis only */
@ -221,7 +221,7 @@ public:
return m_totalScore;
}
float GetScore() const {
return m_totalScore-m_futureScore;
return m_totalScore-m_estimatedScore;
}
const FFState* GetFFState(int idx) const {
return m_ffStates[idx];