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:
authorariel faigon <github.2009@yendor.com>2014-07-11 23:26:32 +0400
committerariel faigon <github.2009@yendor.com>2014-07-11 23:26:32 +0400
commitf5b3140d20d5ecab2c568d282ee205bb6b34ea2f (patch)
tree5c1699b1eeb20e428f4bd83879a84303835a8a62
parente3d5769363912b7558ac7a0a5a1b7d928dfc584a (diff)
parenta9dbb0c7fc0cd056f9a82e5fde95af6aaee0df08 (diff)
Merge branch 'master' of git://github.com/JohnLangford/vowpal_wabbit
-rwxr-xr-xtest/RunTests3
-rw-r--r--test/train-sets/ref/sequencespan_data.nonldf.test-beam20.predict21
-rw-r--r--vowpalwabbit/bfgs.cc1
-rw-r--r--vowpalwabbit/example.h1
-rw-r--r--vowpalwabbit/gd.cc3
-rw-r--r--vowpalwabbit/lda_core.cc6
-rw-r--r--vowpalwabbit/lrq.cc2
-rw-r--r--vowpalwabbit/stagewise_poly.cc4
8 files changed, 13 insertions, 28 deletions
diff --git a/test/RunTests b/test/RunTests
index b89ee3cf..f10e05b3 100755
--- a/test/RunTests
+++ b/test/RunTests
@@ -964,9 +964,8 @@ __DATA__
train-sets/ref/sequencespan_data.nonldf.test-beam1.predict
# Test 54: searn sequence SPAN labeling BIO, non-ldf test, beam 20
-{VW} -d train-sets/sequencespan_data -t --search_span_bilou -i models/sequencespan_data.model -p sequencespan_data.predict --search_beam 20 --search_kbest 20 --quiet
+{VW} -d train-sets/sequencespan_data -t --search_span_bilou -i models/sequencespan_data.model --search_beam 20 --search_kbest 20 --quiet
train-sets/ref/sequencespan_data.nonldf.test-beam20.stderr
- train-sets/ref/sequencespan_data.nonldf.test-beam20.predict
# Test 55: searn sequence SPAN labeling BILOU, non-ldf train
{VW} -k -c -d train-sets/sequencespan_data --passes 20 --invariant --search_rollout oracle --search_alpha 1e-8 --search_task sequencespan --search_span_bilou --search 7 --holdout_off -f models/sequencespan_data.model
diff --git a/test/train-sets/ref/sequencespan_data.nonldf.test-beam20.predict b/test/train-sets/ref/sequencespan_data.nonldf.test-beam20.predict
deleted file mode 100644
index 9e724204..00000000
--- a/test/train-sets/ref/sequencespan_data.nonldf.test-beam20.predict
+++ /dev/null
@@ -1,21 +0,0 @@
--0.781838 2 6 1 6 2 1 6 4 5 4 5 1 4 6 6
--0.781838 2 6 1 6 2 1 6 4 5 4 5 1 4 6 6
--0.781838 2 6 1 6 2 1 6 4 5 4 5 1 4 6 7
--0.781838 2 6 1 6 2 1 6 4 5 4 5 1 4 6 7
--0.781838 2 6 1 6 2 1 6 4 5 4 5 1 6 6 6
--0.781838 2 6 1 6 2 1 6 4 5 4 5 1 6 6 6
--0.781838 2 6 1 6 2 1 6 4 5 4 5 1 6 6 7
--0.781838 2 6 1 6 2 1 6 4 5 4 5 1 6 6 7
--0.781838 2 6 1 6 2 1 6 4 5 4 5 1 6 7 7
--0.781838 2 6 1 6 2 1 6 4 5 4 5 1 6 7 7
--0.781838 2 6 1 6 2 1 6 4 5 4 5 1 6 7 6
--0.781838 2 6 1 6 2 1 6 4 5 4 5 1 6 7 6
--0.781811 2 6 1 6 2 6 6 4 5 4 5 1 4 6 6
--0.781811 2 6 1 6 2 6 6 4 5 4 5 1 4 6 6
--0.781811 2 6 1 6 2 6 6 4 5 4 5 1 4 6 7
--0.781811 2 6 1 6 2 6 6 4 5 4 5 1 4 6 7
--0.781811 2 6 1 6 2 6 6 4 5 4 5 1 6 6 6
--0.781811 2 6 1 6 2 6 6 4 5 4 5 1 6 6 6
--0.781811 2 6 1 6 2 6 6 4 5 4 5 1 6 6 7
--0.781811 2 6 1 6 2 6 6 4 5 4 5 1 6 6 7
-
diff --git a/vowpalwabbit/bfgs.cc b/vowpalwabbit/bfgs.cc
index 59eed947..98652beb 100644
--- a/vowpalwabbit/bfgs.cc
+++ b/vowpalwabbit/bfgs.cc
@@ -753,6 +753,7 @@ void process_example(vw& all, bfgs& b, example& ec)
float sd = all.loss->second_derivative(all.sd, b.predictions[b.example_number++],ld->label);
b.curvature += d_dot_x*d_dot_x*sd*ld->weight;
}
+ ec.updated_prediction = ld->prediction;
if (b.preconditioner_pass)
update_preconditioner(all, ec);//w[3]
diff --git a/vowpalwabbit/example.h b/vowpalwabbit/example.h
index 0822642e..cd665718 100644
--- a/vowpalwabbit/example.h
+++ b/vowpalwabbit/example.h
@@ -47,6 +47,7 @@ struct example // core example datatype.
size_t num_features;//precomputed, cause it's fast&easy.
float partial_prediction;//shared data for prediction.
+ float updated_prediction;//estimated post-update prediction.
v_array<float> topic_predictions;
float loss;
float example_t;//sum of importance weights so far.
diff --git a/vowpalwabbit/gd.cc b/vowpalwabbit/gd.cc
index 556f16fa..6991db8d 100644
--- a/vowpalwabbit/gd.cc
+++ b/vowpalwabbit/gd.cc
@@ -27,7 +27,6 @@ license as described in the file LICENSE.
using namespace std;
using namespace LEARNER;
//todo:
-//3. Make updated_prediction work
//4. Factor various state out of vw&
namespace GD
{
@@ -490,6 +489,8 @@ float compute_update(gd& g, example& ec)
update = all.loss->getUpdate(ld->prediction, ld->label, delta_pred, pred_per_update);
else
update = all.loss->getUnsafeUpdate(ld->prediction, ld->label, delta_pred, pred_per_update);
+
+ ec.updated_prediction = ec.partial_prediction + pred_per_update * update;
if (all.reg_mode && fabs(update) > 1e-8) {
double dev1 = all.loss->first_derivative(g.sd, ld->prediction, ld->label);
diff --git a/vowpalwabbit/lda_core.cc b/vowpalwabbit/lda_core.cc
index 76a5f163..e503c8ff 100644
--- a/vowpalwabbit/lda_core.cc
+++ b/vowpalwabbit/lda_core.cc
@@ -770,7 +770,11 @@ learner* setup(vw&all, po::variables_map& vm)
all.random_weights = true;
all.add_constant = false;
- if (vm.count("lda") && all.eta > 1.)
+ std::stringstream ss;
+ ss << " --lda " << all.lda;
+ all.file_options.append(ss.str());
+
+ if (all.eta > 1.)
{
cerr << "your learning rate is too high, setting it to 1" << endl;
all.eta = min(all.eta,1.f);
diff --git a/vowpalwabbit/lrq.cc b/vowpalwabbit/lrq.cc
index 7dc99509..897395dd 100644
--- a/vowpalwabbit/lrq.cc
+++ b/vowpalwabbit/lrq.cc
@@ -133,7 +133,7 @@ namespace LRQ {
ec.atomics[right].push_back (lrq);
- if (all.audit || all.hash_inv)
+ if (iter == 0 && (all.audit || all.hash_inv))
{
char* new_space = (char*)calloc_or_die(4, sizeof(char));
strcpy(new_space, "lrq");
diff --git a/vowpalwabbit/stagewise_poly.cc b/vowpalwabbit/stagewise_poly.cc
index 6d521b25..9612a2d5 100644
--- a/vowpalwabbit/stagewise_poly.cc
+++ b/vowpalwabbit/stagewise_poly.cc
@@ -350,10 +350,10 @@ namespace StagewisePoly
if (poly.cur_depth < min_depths_get(poly, wid_cur) && poly.training) {
if (parent_get(poly, wid_cur)) {
//#ifdef DEBUG
- cout
+ /* cout
<< "FOUND A TRANSPLANT!!! moving [" << wid_cur
<< "] from depth " << (uint32_t) min_depths_get(poly, wid_cur)
- << " to depth " << poly.cur_depth << endl;
+ << " to depth " << poly.cur_depth << endl;*/
//#endif //DEBUG
parent_toggle(poly, wid_cur);
}