From 1ce8f44fe74cb6fb9223c4a2a4050019fed3be49 Mon Sep 17 00:00:00 2001
From: Patrick Simianer
Date: Wed, 16 Nov 2011 10:57:44 +0100
Subject: fix
---
dtrain/dtrain.cc | 12 ++++++------
dtrain/dtrain.h | 1 +
2 files changed, 7 insertions(+), 6 deletions(-)
(limited to 'dtrain')
diff --git a/dtrain/dtrain.cc b/dtrain/dtrain.cc
index 7cc6af6f..0853173f 100644
--- a/dtrain/dtrain.cc
+++ b/dtrain/dtrain.cc
@@ -482,7 +482,7 @@ main(int argc, char** argv)
model_diff = model_avg;
}
- if (true) {
+ if (!quiet) {
cerr << _p5 << _p << "WEIGHTS" << endl;
for (vector::iterator it = print_weights.begin(); it != print_weights.end(); it++) {
cerr << setw(18) << *it << " = " << lambdas.get(FD::Convert(*it)) << endl;
@@ -501,11 +501,11 @@ main(int argc, char** argv)
}
if (hstreaming) {
- rep.update_counter("Score 1best avg #"+boost::lexical_cast(t+1), (unsigned)(score_avg*100000));
- rep.update_counter("Model 1best avg #"+boost::lexical_cast(t+1), (unsigned)(model_avg*100000));
- rep.update_counter("Pairs avg #"+boost::lexical_cast(t+1), (unsigned)((npairs/(weight_t)in_sz)*100000));
- rep.update_counter("Rank errors avg #"+boost::lexical_cast(t+1), (unsigned)((rank_errors/(weight_t)in_sz)*100000));
- rep.update_counter("Margin violations avg #"+boost::lexical_cast(t+1), (unsigned)((margin_violations/(weight_t)in_sz)*100000));
+ rep.update_counter("Score 1best avg #"+boost::lexical_cast(t+1), (unsigned)(score_avg*_SCALE));
+ rep.update_counter("Model 1best avg #"+boost::lexical_cast(t+1), (unsigned)(model_avg*_SCALE));
+ rep.update_counter("Pairs avg #"+boost::lexical_cast(t+1), (unsigned)((npairs/(weight_t)in_sz)*_SCALE));
+ rep.update_counter("Rank errors avg #"+boost::lexical_cast(t+1), (unsigned)((rank_errors/(weight_t)in_sz)*_SCALE));
+ rep.update_counter("Margin violations avg #"+boost::lexical_cast(t+1), (unsigned)((margin_violations/(weight_t)in_sz)*_SCALE));
unsigned nonz = (unsigned)lambdas.size_nonzero();
rep.update_counter("Non zero feature count #"+boost::lexical_cast(t+1), nonz);
rep.update_gcounter("Non zero feature count #"+boost::lexical_cast(t+1), nonz);
diff --git a/dtrain/dtrain.h b/dtrain/dtrain.h
index 1b33c081..f0d8fd45 100644
--- a/dtrain/dtrain.h
+++ b/dtrain/dtrain.h
@@ -19,6 +19,7 @@
#define DTRAIN_DOTS 100 // when to display a '.'
#define DTRAIN_GRAMMAR_DELIM "########EOS########"
+#define _SCALE 100000
using namespace std;
using namespace dtrain;
--
cgit v1.2.3