summaryrefslogtreecommitdiff
path: root/dtrain
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2011-11-16 10:57:44 +0100
committerPatrick Simianer <p@simianer.de>2011-11-16 10:57:44 +0100
commit868d01c156914faaf85335c86374cc8f47a61b96 (patch)
tree48799a93b7a1a343597830cfcf66971b7e105b32 /dtrain
parenta31b9b2bfdb232cc8fb2e4f05326c01c0cd2323d (diff)
fix
Diffstat (limited to 'dtrain')
-rw-r--r--dtrain/dtrain.cc12
-rw-r--r--dtrain/dtrain.h1
2 files changed, 7 insertions, 6 deletions
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<string>::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<string>(t+1), (unsigned)(score_avg*100000));
- rep.update_counter("Model 1best avg #"+boost::lexical_cast<string>(t+1), (unsigned)(model_avg*100000));
- rep.update_counter("Pairs avg #"+boost::lexical_cast<string>(t+1), (unsigned)((npairs/(weight_t)in_sz)*100000));
- rep.update_counter("Rank errors avg #"+boost::lexical_cast<string>(t+1), (unsigned)((rank_errors/(weight_t)in_sz)*100000));
- rep.update_counter("Margin violations avg #"+boost::lexical_cast<string>(t+1), (unsigned)((margin_violations/(weight_t)in_sz)*100000));
+ rep.update_counter("Score 1best avg #"+boost::lexical_cast<string>(t+1), (unsigned)(score_avg*_SCALE));
+ rep.update_counter("Model 1best avg #"+boost::lexical_cast<string>(t+1), (unsigned)(model_avg*_SCALE));
+ rep.update_counter("Pairs avg #"+boost::lexical_cast<string>(t+1), (unsigned)((npairs/(weight_t)in_sz)*_SCALE));
+ rep.update_counter("Rank errors avg #"+boost::lexical_cast<string>(t+1), (unsigned)((rank_errors/(weight_t)in_sz)*_SCALE));
+ rep.update_counter("Margin violations avg #"+boost::lexical_cast<string>(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<string>(t+1), nonz);
rep.update_gcounter("Non zero feature count #"+boost::lexical_cast<string>(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;