summaryrefslogtreecommitdiff
path: root/utils/ccrp.h
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-03-05 21:36:07 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2012-03-05 21:36:07 -0500
commitde34b1493df93169c991a1828f951ca5abc00cae (patch)
tree81f691d66cf5e3c3775634a266482ea9b7163081 /utils/ccrp.h
parent2048ac9943e2695a75b5f0303ca869e66ee32202 (diff)
tie hyperparameters for translation distributions; support theta < 0 for PYPLM
Diffstat (limited to 'utils/ccrp.h')
-rw-r--r--utils/ccrp.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/ccrp.h b/utils/ccrp.h
index e24130ac..439d7e1e 100644
--- a/utils/ccrp.h
+++ b/utils/ccrp.h
@@ -225,12 +225,12 @@ class CCRP {
StrengthResampler sr(*this);
for (int iter = 0; iter < nloop; ++iter) {
if (has_strength_prior()) {
- strength_ = slice_sampler1d(sr, strength_, *rng, -discount_,
+ strength_ = slice_sampler1d(sr, strength_, *rng, -discount_ + std::numeric_limits<double>::min(),
std::numeric_limits<double>::infinity(), 0.0, niterations, 100*niterations);
}
if (has_discount_prior()) {
double min_discount = std::numeric_limits<double>::min();
- if (strength_ < 0.0) min_discount = -strength_;
+ if (strength_ < 0.0) min_discount -= strength_;
discount_ = slice_sampler1d(dr, discount_, *rng, min_discount,
1.0, 0.0, niterations, 100*niterations);
}