diff options
author | Stephane Ross <stephaneross@cmu.edu> | 2012-08-30 22:05:28 +0400 |
---|---|---|
committer | Stephane Ross <stephaneross@cmu.edu> | 2012-08-30 22:05:28 +0400 |
commit | 14c062a7bf91cef81a3f215ca747b2c54bfa1ee0 (patch) | |
tree | bddd51f2e8a20947997be00193a2d8cdf05c89c0 /vowpalwabbit/sparse_dense.h | |
parent | c5531bf697dc9235dc5e2fc3afb0a32c384b92e4 (diff) |
Update to normalized updates so that weight are rescaled when range increase
Diffstat (limited to 'vowpalwabbit/sparse_dense.h')
-rw-r--r-- | vowpalwabbit/sparse_dense.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vowpalwabbit/sparse_dense.h b/vowpalwabbit/sparse_dense.h index 6ae8498e..4aa74679 100644 --- a/vowpalwabbit/sparse_dense.h +++ b/vowpalwabbit/sparse_dense.h @@ -18,6 +18,10 @@ inline float trunc_weight(float w, float gravity){ float sd_add(weight* weights, size_t mask, feature* begin, feature* end); float sd_add_trunc(weight* weights, size_t mask, feature* begin, feature* end, float gravity); +float sd_add_rescale(weight* weights, size_t mask, feature* begin, feature* end, bool is_adaptive, size_t idx_norm); +float sd_add_trunc_rescale(weight* weights, size_t mask, feature* begin, feature* end, float gravity, bool is_adaptive, size_t idx_norm); +float sd_add_rescale_general(weight* weights, size_t mask, feature* begin, feature* end, size_t idx_norm, float power_t_norm); +float sd_add_trunc_rescale_general(weight* weights, size_t mask, feature* begin, feature* end, float gravity, size_t idx_norm, float power_t_norm); float sd_offset_add(weight* weights, size_t mask, feature* begin, feature* end, size_t offset); void sd_offset_update(weight* weights, size_t mask, feature* begin, feature* end, size_t offset, float update, float regularization); @@ -31,6 +35,11 @@ float one_pf_quad_predict(weight* weights, feature& page_feature, v_array<featur float one_pf_quad_predict_trunc(weight* weights, feature& f, v_array<feature> &cross_features, size_t mask, float gravity); +float one_pf_quad_predict_rescale(weight* weights, feature& page_feature, v_array<feature> &offer_features, size_t mask, bool is_adaptive, size_t idx_norm); +float one_pf_quad_predict_trunc_rescale(weight* weights, feature& f, v_array<feature> &cross_features, size_t mask, float gravity, bool is_adaptive, size_t idx_norm); +float one_pf_quad_predict_rescale_general(weight* weights, feature& page_feature, v_array<feature> &offer_features, size_t mask, size_t idx_norm, float power_t_norm); +float one_pf_quad_predict_trunc_rescale_general(weight* weights, feature& f, v_array<feature> &cross_features, size_t mask, float gravity, size_t idx_norm, float power_t_norm); + float offset_quad_predict(weight* weights, feature& page_feature, v_array<feature> &offer_features, size_t mask, size_t offset); void print_audit_quad(weight* weights, audit_data& page_feature, v_array<audit_data> &offer_features, size_t mask); |