1
1

When using vowpal wabbit for passive learning tasks, it is easy to retain the final model by using the -f flag. However, when this is hooked up to active learning, I can't seem to retain the model once I've finished labelling.

I know that VW knows that the final model is as I've named it (as the debug information is displayed below) but even when I've sent VW all of my examples, VW doesn't seem to end and then it doesn't write the weights to a file.

So my question is, is there some kind of message you can send the VW server to tell it that you've finished labelling? And is there a way to retain the final model once you've finished labelling?

For reference my VW server command was:

vw -f final.model --active_learning --active_mellowness 0.01 --port 12345 --daemon 

And I'm using the python active_interactor.py found in the VW repository using:

python active_interactor.py localhost 12345 data.txt -o labelled.txt --verbose --seed seed.txt
final_regressor = final.model
Num weight bits = 18
learning rate = 0.5
initial_t = 0
power_t = 0.5
decay_learning_rate = 1
using no cache
calling accept
reading data from port 26346
num sources = 1

asked Nov 19 '13 at 02:04

Jason%20Wong's gravatar image

Jason Wong
21236

edited Nov 19 '13 at 02:15


One Answer:

You may save your model by sending a 'command example' to vowpal_wabbit while it is running.

A 'command example' starts with a string rather than a numeric label.

In this case, the command prefix should be save_ followed by the name of the file and a pipe character. For example:

     save_foo.model|

will save your in memory model into a file foo.model

Source code reference: vowpalwabbit/learner.cc:

    else if (ec->tag.size() >= 4 && !strncmp((const char*) ec->tag.begin, "save", 4))
          {//save state
          ...

answered Nov 20 '13 at 01:55

Ariel%20Faigon's gravatar image

Ariel Faigon
5623

edited Nov 20 '13 at 01:56

Your answer
toggle preview

powered by OSQA

User submitted content is under Creative Commons: Attribution - Share Alike; Other things copyright (C) 2010, MetaOptimize LLC.