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:
authorJacob Hofman <hofman@research-mm10.corp.sp1.yahoo.com>2010-09-22 23:57:57 +0400
committerJacob Hofman <hofman@research-mm10.corp.sp1.yahoo.com>2010-09-22 23:57:57 +0400
commit514311c9f089b20c2cf6ac22e823058fd23138ba (patch)
treec5d147f1ccd8eb7dfe96fea0916e3d69653a6200 /sparse_dense.cc
parentdc0ad64407c464dc00046a1c83b36fda086ff391 (diff)
commit before modifying for differential predictions. currently loss eventually blows up
Diffstat (limited to 'sparse_dense.cc')
-rw-r--r--sparse_dense.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sparse_dense.cc b/sparse_dense.cc
index fe2b1cc6..7320b865 100644
--- a/sparse_dense.cc
+++ b/sparse_dense.cc
@@ -23,6 +23,12 @@ float sd_offset_add(weight* weights, size_t mask, feature* begin, feature* end,
return ret;
}
+void sd_offset_update(weight* weights, size_t mask, feature* begin, feature* end, size_t offset, float update)
+{
+ for (feature* f = begin; f!= end; f++)
+ weights[(f->weight_index + offset) & mask] += f->x * update;
+}
+
void quadratic(v_array<feature> &f, const v_array<feature> &first_part,
const v_array<feature> &second_part, size_t thread_mask)
{