diff options
Diffstat (limited to 'vowpalwabbit/noop.cc')
-rw-r--r-- | vowpalwabbit/noop.cc | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/vowpalwabbit/noop.cc b/vowpalwabbit/noop.cc index b8a72155..6cb3c44f 100644 --- a/vowpalwabbit/noop.cc +++ b/vowpalwabbit/noop.cc @@ -3,36 +3,13 @@ Copyright (c) by respective owners including Yahoo!, Microsoft, and individual contributors. All rights reserved. Released under a BSD (revised) license as described in the file LICENSE. */ -// This is a function which does nothing with examples. Used when VW is used as a compressor. +// This is a learner which does nothing with examples. Used when VW is used as a compressor. -#include "example.h" -#include "parser.h" -#include "gd.h" -#include "simple_label.h" #include "vw.h" namespace NOOP { - void learn(void* d, example*ec) {} - void finish(void* d) {} - - void save_load(void* d, io_buf& model_file, bool read, bool text) {} - - void drive(vw* all, void* d) - { - example* ec = NULL; - - while ( !parser_done(all->p)){ - ec = VW::get_example(all->p); - if (ec != NULL) - return_simple_example(*all, ec); - } - } - - learner setup(vw& all) + learner* setup(vw& all) { - sl_t sl = {NULL,save_load}; - all.is_noop = true; - learner l(NULL,drive,learn,finish,sl); - return l; + return new learner(); } } |