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
commit7b3936660fb777b455079c63c23aec00f60f98ea (patch)
tree1098d2e74e88001b8b4fdb62cf961365f3e73211 /utils/ccrp.h
parent4c007d48d5829233d0ae3c3c8b48f8c25631bf81 (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);
}