Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/vowpal_wabbit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Langford <jl@hunch.net>2009-08-06 00:56:31 +0400
committerJohn Langford <jl@hunch.net>2009-08-06 00:56:31 +0400
commit2304e87f5072c482ed0cc6c650c6b8b1860e55ac (patch)
treee07ee452b2b3e9d167d8e776525abb41a9cc21f7 /main.cc
parent79e19938094aae8210c7764f9fc59d7d312296a4 (diff)
Moved core thread creation into gd.
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc46
1 files changed, 23 insertions, 23 deletions
diff --git a/main.cc b/main.cc
index e95bd411..bb39c978 100644
--- a/main.cc
+++ b/main.cc
@@ -8,27 +8,27 @@ embodied in the content of this file are licensed under the BSD
#include "gd.h"
-int main(int argc, char *argv[]) {
- gd_vars *vars = vw(argc, argv);
-
- float best_constant = vars->weighted_labels / vars->weighted_examples;
- float constant_loss = (best_constant*(1.0 - best_constant)*(1.0 - best_constant)
- + (1.0 - best_constant)*best_constant*best_constant);
-
- if (!vars->quiet)
- {
- cerr.precision(4);
- cerr << endl << "finished run";
- cerr << endl << "number of examples = " << vars->example_number;
- cerr << endl << "weighted example sum = " << vars->weighted_examples;
- cerr << endl << "weighted label sum = " << vars->weighted_labels;
- cerr << endl << "average loss = " << vars->sum_loss / vars->weighted_examples;
- cerr << endl << "best constant's loss = " << constant_loss;
- cerr << endl << "total feature number = " << vars->total_features;
- cerr << endl;
- }
-
- free(vars);
-
- return 0;
+int main(int argc, char *argv[])
+{
+ gd_vars *vars = vw(argc, argv);
+
+ float best_constant = vars->weighted_labels / vars->weighted_examples;
+ float constant_loss = (best_constant*(1.0 - best_constant)*(1.0 - best_constant)
+ + (1.0 - best_constant)*best_constant*best_constant);
+
+ if (!vars->quiet)
+ {
+ cerr.precision(4);
+ cerr << endl << "finished run";
+ cerr << endl << "number of examples = " << vars->example_number;
+ cerr << endl << "weighted example sum = " << vars->weighted_examples;
+ cerr << endl << "weighted label sum = " << vars->weighted_labels;
+ cerr << endl << "average loss = " << vars->sum_loss / vars->weighted_examples;
+ cerr << endl << "best constant's loss = " << constant_loss;
+ cerr << endl << "total feature number = " << vars->total_features;
+ cerr << endl;
+ }
+ delete vars;
+
+ return 0;
}