summaryrefslogtreecommitdiff
path: root/dtrain
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2011-10-19 21:41:00 +0200
committerPatrick Simianer <p@simianer.de>2011-10-19 21:41:00 +0200
commit1f54c7b765d4f933f4b631f265933f28e4ae2c93 (patch)
tree884bc61734d05ad0a8a3d906be002fc30699ea89 /dtrain
parent967e1c98980b07909b03ff5e3e71442cbeb216e8 (diff)
debug
Diffstat (limited to 'dtrain')
-rw-r--r--dtrain/dtrain.cc21
-rw-r--r--dtrain/kbestget.h8
2 files changed, 12 insertions, 17 deletions
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<double> a(2.2);
- //LogVal<double> b(2.1);
- //cout << a << endl;
- //cout << log(a) << endl;
- //LogVal<double> 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<weight_t> 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);