summaryrefslogtreecommitdiff
path: root/gi/pf/learn_cfg.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-03-05 16:06:45 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2012-03-05 16:06:45 -0500
commit2048ac9943e2695a75b5f0303ca869e66ee32202 (patch)
tree35de13bff0ce7f1fde619d04d165f7e6ac5b0631 /gi/pf/learn_cfg.cc
parentce58cb44771a5194b71682d1602abe2fef9e6f13 (diff)
use template parameter inference to figure out what type to use for probability computations, templatatize number of floors in MFCR rather than compile-time set
Diffstat (limited to 'gi/pf/learn_cfg.cc')
-rw-r--r--gi/pf/learn_cfg.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gi/pf/learn_cfg.cc b/gi/pf/learn_cfg.cc
index bf157828..ed1772bf 100644
--- a/gi/pf/learn_cfg.cc
+++ b/gi/pf/learn_cfg.cc
@@ -127,20 +127,20 @@ struct HieroLMModel {
nts(num_nts, CCRP<TRule>(1,1,1,1)) {}
prob_t Prob(const TRule& r) const {
- return nts[nt_id_to_index[-r.lhs_]].probT<prob_t>(r, p0(r));
+ return nts[nt_id_to_index[-r.lhs_]].prob(r, p0(r));
}
inline prob_t p0(const TRule& r) const {
if (kHIERARCHICAL_PRIOR)
- return q0.probT<prob_t>(r, base(r));
+ return q0.prob(r, base(r));
else
return base(r);
}
int Increment(const TRule& r, MT19937* rng) {
- const int delta = nts[nt_id_to_index[-r.lhs_]].incrementT<prob_t>(r, p0(r), rng);
+ const int delta = nts[nt_id_to_index[-r.lhs_]].increment(r, p0(r), rng);
if (kHIERARCHICAL_PRIOR && delta)
- q0.incrementT<prob_t>(r, base(r), rng);
+ q0.increment(r, base(r), rng);
return delta;
// return x.increment(r);
}