diff options
author | John Langford <jl@hunch.net> | 2013-03-20 02:13:36 +0400 |
---|---|---|
committer | John Langford <jl@hunch.net> | 2013-03-20 02:13:36 +0400 |
commit | 15fd77423edf07315da39ad4954cdf59c6f492df (patch) | |
tree | 5f8ef423f1cad628a360a9106d60f6879bc91823 /vowpalwabbit/gd_mf.cc | |
parent | 51b200e6a86052a12241188a4c7ba334991f6674 (diff) |
type the global
Diffstat (limited to 'vowpalwabbit/gd_mf.cc')
-rw-r--r-- | vowpalwabbit/gd_mf.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/vowpalwabbit/gd_mf.cc b/vowpalwabbit/gd_mf.cc index 6f106b25..f3bba83c 100644 --- a/vowpalwabbit/gd_mf.cc +++ b/vowpalwabbit/gd_mf.cc @@ -207,9 +207,8 @@ float mf_predict(vw& all, example* ex) return ex->final_prediction; } - void save_load(void* in, void* d, io_buf& model_file, bool read, bool text) + void save_load(vw* all, void* d, io_buf& model_file, bool read, bool text) { - vw* all = (vw*)in; uint32_t length = 1 << all->num_bits; uint32_t stride = all->stride; @@ -261,9 +260,8 @@ float mf_predict(vw& all, example* ex) } } - void learn(void* in, void* d, example* ec) + void learn(vw* all, void* d, example* ec) { - vw* all = (vw*)in; if (ec->end_pass) all->eta *= all->eta_decay_rate; @@ -275,20 +273,18 @@ float mf_predict(vw& all, example* ex) } } - void finish(void* a, void* d) + void finish(vw* a, void* d) { } - void drive(void* in, void* d) + void drive(vw* all, void* d) { - vw* all = (vw*)in; - example* ec = NULL; while ( true ) { if ((ec = get_example(all->p)) != NULL)//blocking operation. { - learn(in,d,ec); + learn(all,d,ec); return_simple_example(*all, ec); } else if (parser_done(all->p)) |