From 925087356b853e2099c1b60d8b757d7aa02121a9 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Tue, 2 Oct 2012 00:19:43 -0400 Subject: cdec cleanup, remove bayesian stuff, parsing stuff --- dpmert/Jamfile | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 dpmert/Jamfile (limited to 'dpmert') diff --git a/dpmert/Jamfile b/dpmert/Jamfile deleted file mode 100644 index bc4b079b..00000000 --- a/dpmert/Jamfile +++ /dev/null @@ -1,32 +0,0 @@ -import testing ; -import lex ; -import option ; - -lib dpmert : - ces.cc - error_surface.cc - line_optimizer.cc - mert_geometry.cc - ..//utils - ..//mteval - ..//decoder - ../klm/lm//kenlm - ..//boost_program_options - : . - : : - ..//utils - ..//mteval - ../klm/lm//kenlm - ..//boost_program_options - . - ; - -all_tests [ glob *_test.cc ] : dpmert : $(TOP)/dpmert/test_data ; - -exe sentserver : sentserver.c : multi ; -exe sentclient : sentclient.c ; -exe mr_dpmert_generate_mapper_input : mr_dpmert_generate_mapper_input.cc dpmert ..//boost_program_options ; -exe mr_dpmert_map : mr_dpmert_map.cc dpmert ..//boost_program_options ; -exe mr_dpmert_reduce : mr_dpmert_reduce.cc dpmert ..//boost_program_options ; - -alias programs : sentserver sentclient mr_dpmert_generate_mapper_input mr_dpmert_map mr_dpmert_reduce ; -- cgit v1.2.3 From 2e00c663cf271233610dc1633c7fb1d4a43cd214 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Tue, 16 Oct 2012 01:42:55 -0400 Subject: c++11 compatibility --- dpmert/lo_test.cc | 2 +- training/cllh_observer.cc | 2 +- training/collapse_weights.cc | 2 +- training/mpi_batch_optimize.cc | 2 +- training/mpi_online_optimize.cc | 4 ++-- training/mr_optimize_reduce.cc | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'dpmert') diff --git a/dpmert/lo_test.cc b/dpmert/lo_test.cc index 2daf87bb..95a08d3d 100644 --- a/dpmert/lo_test.cc +++ b/dpmert/lo_test.cc @@ -36,7 +36,7 @@ BOOST_AUTO_TEST_CASE( TestCheckNaN) { double x = 0; double y = 0; double z = x / y; - BOOST_CHECK_EQUAL(true, isnan(z)); + BOOST_CHECK_EQUAL(true, std::isnan(z)); } BOOST_AUTO_TEST_CASE(TestConvexHull) { diff --git a/training/cllh_observer.cc b/training/cllh_observer.cc index 58232769..4ec2fa65 100644 --- a/training/cllh_observer.cc +++ b/training/cllh_observer.cc @@ -45,7 +45,7 @@ void ConditionalLikelihoodObserver::NotifyAlignmentForest(const SentenceMetadata cerr << "DIFF. ERR! log_model_z < log_ref_z: " << cur_obj << " " << log_ref_z << endl; exit(1); } - assert(!isnan(log_ref_z)); + assert(!std::isnan(log_ref_z)); acc_obj += (cur_obj - log_ref_z); trg_words += smeta.GetReference().size(); } diff --git a/training/collapse_weights.cc b/training/collapse_weights.cc index dc480f6c..c03eb031 100644 --- a/training/collapse_weights.cc +++ b/training/collapse_weights.cc @@ -95,7 +95,7 @@ int main(int argc, char** argv) { if (line.empty()) continue; TRule tr(line, true); const double lp = tr.GetFeatureValues().dot(w); - if (isinf(lp)) { continue; } + if (std::isinf(lp)) { continue; } tr.scores_.clear(); cout << tr.AsString() << " ||| F_and_E=" << lp - log(tot); diff --git a/training/mpi_batch_optimize.cc b/training/mpi_batch_optimize.cc index 6432f4a2..2eff07e4 100644 --- a/training/mpi_batch_optimize.cc +++ b/training/mpi_batch_optimize.cc @@ -142,7 +142,7 @@ struct TrainingObserver : public DecoderObserver { cerr << "DIFF. ERR! log_model_z < log_ref_z: " << cur_obj << " " << log_ref_z << endl; exit(1); } - assert(!isnan(log_ref_z)); + assert(!std::isnan(log_ref_z)); ref_exp -= cur_model_exp; acc_grad -= ref_exp; acc_obj += (cur_obj - log_ref_z); diff --git a/training/mpi_online_optimize.cc b/training/mpi_online_optimize.cc index 993627f0..d6968848 100644 --- a/training/mpi_online_optimize.cc +++ b/training/mpi_online_optimize.cc @@ -143,7 +143,7 @@ struct TrainingObserver : public DecoderObserver { cerr << "DIFF. ERR! log_model_z < log_ref_z: " << cur_obj << " " << log_ref_z << endl; exit(1); } - assert(!isnan(log_ref_z)); + assert(!std::isnan(log_ref_z)); ref_exp -= cur_model_exp; acc_grad += ref_exp; acc_obj += (cur_obj - log_ref_z); @@ -330,7 +330,7 @@ int main(int argc, char** argv) { if (rank == 0) { converged = (iter == max_iteration); Weights::SanityCheck(lambdas); - Weights::ShowLargestFeatures(lambdas); + static int cc = 0; ++cc; if (cc > 1) { Weights::ShowLargestFeatures(lambdas); } string fname = "weights.cur.gz"; if (iter % write_weights_every_ith == 0) { ostringstream o; o << "weights.epoch_" << (ai+1) << '.' << iter << ".gz"; diff --git a/training/mr_optimize_reduce.cc b/training/mr_optimize_reduce.cc index 461e6b5f..d490192f 100644 --- a/training/mr_optimize_reduce.cc +++ b/training/mr_optimize_reduce.cc @@ -19,8 +19,8 @@ namespace po = boost::program_options; void SanityCheck(const vector& w) { for (int i = 0; i < w.size(); ++i) { - assert(!isnan(w[i])); - assert(!isinf(w[i])); + assert(!std::isnan(w[i])); + assert(!std::isinf(w[i])); } } -- cgit v1.2.3 From 500cf9773a88993ea4fa3d17e7f886dfcf7a546e Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Mon, 22 Oct 2012 20:12:30 -0400 Subject: something to get the error surface out --- dpmert/line_optimizer.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'dpmert') diff --git a/dpmert/line_optimizer.cc b/dpmert/line_optimizer.cc index 49443fbe..9cf33502 100644 --- a/dpmert/line_optimizer.cc +++ b/dpmert/line_optimizer.cc @@ -56,7 +56,10 @@ double LineOptimizer::LineOptimize( //cerr << "NEW BEST: " << pos << " (score=" << cur_best_score << ")\n"; } // string xx = metric->DetailedScore(acc); cerr << "---- " << xx; - // cerr << "---- s=" << sco << "\n"; +#undef SHOW_ERROR_SURFACES +#ifdef SHOW_ERROR_SURFACES + cerr << "x=" << seg.x << "\ts=" << sco << "\n"; +#endif last_boundary = seg.x; } // cerr << "x-boundary=" << seg.x << "\n"; -- cgit v1.2.3