diff options
author | John Langford <jl@hunch.net> | 2009-08-06 00:56:31 +0400 |
---|---|---|
committer | John Langford <jl@hunch.net> | 2009-08-06 00:56:31 +0400 |
commit | 2304e87f5072c482ed0cc6c650c6b8b1860e55ac (patch) | |
tree | e07ee452b2b3e9d167d8e776525abb41a9cc21f7 /main.cc | |
parent | 79e19938094aae8210c7764f9fc59d7d312296a4 (diff) |
Moved core thread creation into gd.
Diffstat (limited to 'main.cc')
-rw-r--r-- | main.cc | 46 |
1 files changed, 23 insertions, 23 deletions
@@ -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; } |