From 18ba09140e937bde6c94247640484fe44f7cd665 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Wed, 19 Oct 2011 21:41:00 +0200 Subject: debug --- dtrain/dtrain.cc | 21 +++++++-------------- dtrain/kbestget.h | 8 +++++--- 2 files changed, 12 insertions(+), 17 deletions(-) (limited to 'dtrain') diff --git a/dtrain/dtrain.cc b/dtrain/dtrain.cc index e96b65aa..795c82fd 100644 --- a/dtrain/dtrain.cc +++ b/dtrain/dtrain.cc @@ -188,15 +188,6 @@ main(int argc, char** argv) } - //LogVal a(2.2); - //LogVal b(2.1); - //cout << a << endl; - //cout << log(a) << endl; - //LogVal c = a - b; - //cout << log(c) << endl; - //exit(0); - - for (unsigned t = 0; t < T; t++) // T epochs { @@ -298,7 +289,7 @@ main(int argc, char** argv) // FIXME /*if (verbose) { cout << "[ref: '"; - if (t > 0) cout << ref_ids_buf[ii]; + if (t > 0) cout << ref_ids_buf[ii]; <--- else cout << ref_ids; cout << endl; cout << _p5 << _np << "1best: " << "'" << (*samples)[0].w << "'" << endl; @@ -355,14 +346,16 @@ main(int argc, char** argv) } } - + // DEBUG vector x; lambdas.init_vector(&x); - for (int q = 0; q < x.size(); q++) { - if (x[q] < -10 && x[q] != 0) - cout << FD::Convert(q) << " " << x[q] << endl; + cout << "[" << ii << "]" << endl; + for (int jj = 0; jj < x.size(); jj++) { + if (x[jj] != 0) + cout << FD::Convert(jj) << " " << x[jj] << endl; } cout << " --- " << endl; + // /DEBUG ++ii; diff --git a/dtrain/kbestget.h b/dtrain/kbestget.h index 4aadee7a..98f289eb 100644 --- a/dtrain/kbestget.h +++ b/dtrain/kbestget.h @@ -107,8 +107,10 @@ struct KBestGetter : public HypSampler ScoredHyp h; h.w = d->yield; h.f = d->feature_values; - h.model = d->score; - cout << i << ". "<< h.model << endl; + h.model = d->score.as_float(); + // DEBUG + cout << i+1 << ". "<< h.model << endl; + // /DEBUG h.rank = i; h.score = scorer_->Score(h.w, *ref_, i); s_.push_back(h); @@ -127,7 +129,7 @@ struct KBestGetter : public HypSampler ScoredHyp h; h.w = d->yield; h.f = d->feature_values; - h.model = -1*log(d->score); + h.model = d->score.as_float(); h.rank = i; h.score = scorer_->Score(h.w, *ref_, i); s_.push_back(h); -- cgit v1.2.3