diff options
author | John Langford <jl@hunch.net> | 2013-04-04 17:10:35 +0400 |
---|---|---|
committer | John Langford <jl@hunch.net> | 2013-04-04 17:10:35 +0400 |
commit | 4fb6068bd0a3db7627108d68c13feaa9a7e2ea84 (patch) | |
tree | 88eb1e523ed58bbf26c0e0b5f50153f18c067b01 /vowpalwabbit/sparse_dense.h | |
parent | 089cc060439b4c9aced5a3116e40d46731a16a31 (diff) |
migrate weight_mask to regressor definition
Diffstat (limited to 'vowpalwabbit/sparse_dense.h')
-rw-r--r-- | vowpalwabbit/sparse_dense.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vowpalwabbit/sparse_dense.h b/vowpalwabbit/sparse_dense.h index 71762264..4f193c65 100644 --- a/vowpalwabbit/sparse_dense.h +++ b/vowpalwabbit/sparse_dense.h @@ -41,15 +41,15 @@ float one_pf_cubic_predict(vw& all, feature& f0, feature& f1, v_array<feature> c } inline float vec_add(vw& all, float fx, uint32_t fi) { - return all.reg.weight_vector[fi & all.weight_mask] * fx; + return all.reg.weight_vector[fi & all.reg.weight_mask] * fx; } inline float vec_add_trunc(vw& all, float fx, uint32_t fi) { - return trunc_weight(all.reg.weight_vector[fi & all.weight_mask], (float)all.sd->gravity) * fx; + return trunc_weight(all.reg.weight_vector[fi & all.reg.weight_mask], (float)all.sd->gravity) * fx; } inline float vec_add_rescale(vw& all, float fx, uint32_t fi) { - weight* w = &all.reg.weight_vector[fi & all.weight_mask]; + weight* w = &all.reg.weight_vector[fi & all.reg.weight_mask]; float x_abs = fabs(fx); if( x_abs > w[all.normalized_idx] ) {// new scale discovered if( w[all.normalized_idx] > 0. ) {//If the normalizer is > 0 then rescale the weight so it's as if the new scale was the old scale. @@ -62,7 +62,7 @@ inline float vec_add_rescale(vw& all, float fx, uint32_t fi) { } inline float vec_add_trunc_rescale(vw& all, float fx, uint32_t fi) { - weight* w = &all.reg.weight_vector[fi & all.weight_mask]; + weight* w = &all.reg.weight_vector[fi & all.reg.weight_mask]; float x_abs = fabs(fx); if( x_abs > w[all.normalized_idx] ) { if( w[all.normalized_idx] > 0. ) { @@ -75,7 +75,7 @@ inline float vec_add_trunc_rescale(vw& all, float fx, uint32_t fi) { } inline float vec_add_rescale_general(vw& all, float fx, uint32_t fi) { - weight* w = &all.reg.weight_vector[fi & all.weight_mask]; + weight* w = &all.reg.weight_vector[fi & all.reg.weight_mask]; float x_abs = fabs(fx); float power_t_norm = 1.f - (all.adaptive ? all.power_t : 0.f); if( x_abs > w[all.normalized_idx] ) { @@ -89,7 +89,7 @@ inline float vec_add_rescale_general(vw& all, float fx, uint32_t fi) { } inline float vec_add_trunc_rescale_general(vw& all, float fx, uint32_t fi) { - weight* w = &all.reg.weight_vector[fi & all.weight_mask]; + weight* w = &all.reg.weight_vector[fi & all.reg.weight_mask]; float x_abs = fabs(fx); float power_t_norm = 1.f - (all.adaptive ? all.power_t : 0.f); if( x_abs > w[all.normalized_idx] ) { |