summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-05-03 20:57:19 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2012-05-03 20:57:19 -0400
commita3d0e4f8c8f669fd4c0dac7a193a12148253d4e2 (patch)
treeefae433974946cdcd390d60a057ccc023e950a1f
parentd59bad87d2b3ce1abf881b0c4e5bbc7648cf368f (diff)
fix for older gcc
-rw-r--r--dtrain/score.cc2
-rw-r--r--gi/pf/transliterations.cc4
2 files changed, 3 insertions, 3 deletions
diff --git a/dtrain/score.cc b/dtrain/score.cc
index 71d3e5de..7b1f6be4 100644
--- a/dtrain/score.cc
+++ b/dtrain/score.cc
@@ -103,7 +103,7 @@ SmoothBleuScorer::Score(vector<WordID>& hyp, vector<WordID>& ref,
i_bleu[j] += (1/((score_t)j+1)) * i_ng;
}
}
- sum += exp(i_bleu[i])/(pow(2, N_-i));
+ sum += exp(i_bleu[i])/(pow(2.0, static_cast<double>(N_-i)));
}
return brevity_penalty(hyp_len, ref_len) * sum;
}
diff --git a/gi/pf/transliterations.cc b/gi/pf/transliterations.cc
index 2200715e..b2996f65 100644
--- a/gi/pf/transliterations.cc
+++ b/gi/pf/transliterations.cc
@@ -118,7 +118,7 @@ struct TransliterationChunkConditionalModel {
//double llh = Md::log_beta_density(dd, 10, 3) + Md::log_gamma_density(aa, 1, 1);
double llh = //Md::log_beta_density(dd, 1, 1) +
Md::log_gamma_density(dd + aa, 1, 1);
- typename std::tr1::unordered_map<std::vector<WordID>, CCRP_NoTable<TRule>, boost::hash<std::vector<WordID> > >::const_iterator it;
+ std::tr1::unordered_map<std::vector<WordID>, CCRP_NoTable<TRule>, boost::hash<std::vector<WordID> > >::const_iterator it;
for (it = r.begin(); it != r.end(); ++it)
llh += it->second.log_crp_prob(aa);
return llh;
@@ -133,7 +133,7 @@ struct TransliterationChunkConditionalModel {
};
void ResampleHyperparameters(MT19937* rng) {
- typename std::tr1::unordered_map<std::vector<WordID>, CCRP_NoTable<TRule>, boost::hash<std::vector<WordID> > >::iterator it;
+ std::tr1::unordered_map<std::vector<WordID>, CCRP_NoTable<TRule>, boost::hash<std::vector<WordID> > >::iterator it;
//const unsigned nloop = 5;
const unsigned niterations = 10;
//DiscountResampler dr(*this);