summaryrefslogtreecommitdiff
path: root/decoder/cdec.cc
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/cdec.cc')
-rw-r--r--decoder/cdec.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/decoder/cdec.cc b/decoder/cdec.cc
index d517e451..b130e7fd 100644
--- a/decoder/cdec.cc
+++ b/decoder/cdec.cc
@@ -39,6 +39,7 @@ namespace po = boost::program_options;
// some globals ...
boost::shared_ptr<RandomNumberGenerator<boost::mt19937> > rng;
+static const double kMINUS_EPSILON = -1e-6; // don't be too strict
namespace Hack { void MaxTrans(const Hypergraph& in, int beam_size); }
@@ -471,7 +472,7 @@ int main(int argc, char** argv) {
if (write_gradient) {
log_ref_z = log(
InsideOutside<prob_t, EdgeProb, SparseVector<double>, EdgeFeaturesWeightFunction>(forest, &ref_exp));
- if (log_z < log_ref_z) {
+ if ((log_z - log_ref_z) < kMINUS_EPSILON) {
cerr << "DIFF. ERR! log_z < log_ref_z: " << log_z << " " << log_ref_z << endl;
exit(1);
}