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:
authorJohn Langford <jl@nyclamp.(none)>2013-04-01 22:17:26 +0400
committerJohn Langford <jl@nyclamp.(none)>2013-04-01 22:17:26 +0400
commit4fba51a2f64eff47e47e268710338d50f44e104a (patch)
tree094dc1199da9d0a41e9993052a40e665e69a4a90 /vowpalwabbit/vw.h
parent26fb7d8c69ef4791142551dcdaf73f5b42d23b3b (diff)
added interface to weights for library
Diffstat (limited to 'vowpalwabbit/vw.h')
-rw-r--r--vowpalwabbit/vw.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/vowpalwabbit/vw.h b/vowpalwabbit/vw.h
index 59566f2b..0e0e81d5 100644
--- a/vowpalwabbit/vw.h
+++ b/vowpalwabbit/vw.h
@@ -77,6 +77,13 @@ namespace VW {
void add_label(example* ec, float label, float weight = 1, float base = 0);
//notify VW that you are done with the example.
void finish_example(vw& all, example* ec);
+
+ inline float get_weight(vw& all, uint32_t index)
+ { return all.reg.weight_vector[(index * all.stride) & all.weight_mask];}
+
+ inline uint32_t num_weights(vw& all)
+ { return all.length();}
}
+
#endif