diff options
author | John Langford <jl@nyclamp.(none)> | 2013-01-14 22:32:22 +0400 |
---|---|---|
committer | John Langford <jl@nyclamp.(none)> | 2013-01-14 22:32:22 +0400 |
commit | cce2673ffc1e63e7e79f8d083503c94a53114221 (patch) | |
tree | 9df0d1c8b25b46a5e10395952990191a6e3185a1 /vowpalwabbit/sparse_dense.h | |
parent | cc9d17724bc595f4cdc1a5c7e4b75f04f5c75f75 (diff) |
made save/load modular
Diffstat (limited to 'vowpalwabbit/sparse_dense.h')
-rw-r--r-- | vowpalwabbit/sparse_dense.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/vowpalwabbit/sparse_dense.h b/vowpalwabbit/sparse_dense.h index 5d0e82e7..340ad585 100644 --- a/vowpalwabbit/sparse_dense.h +++ b/vowpalwabbit/sparse_dense.h @@ -40,15 +40,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_vectors[fi & all.weight_mask] * fx; + return all.reg.weight_vector[fi & all.weight_mask] * fx; } inline float vec_add_trunc(vw& all, float fx, uint32_t fi) { - return trunc_weight(all.reg.weight_vectors[fi & all.weight_mask], all.sd->gravity) * fx; + return trunc_weight(all.reg.weight_vector[fi & all.weight_mask], all.sd->gravity) * fx; } inline float vec_add_rescale(vw& all, float fx, uint32_t fi) { - weight* w = &all.reg.weight_vectors[fi & all.weight_mask]; + weight* w = &all.reg.weight_vector[fi & all.weight_mask]; float x_abs = fabs(fx); if( x_abs > w[all.normalized_idx] ) { if( w[all.normalized_idx] > 0. ) { @@ -61,7 +61,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_vectors[fi & all.weight_mask]; + weight* w = &all.reg.weight_vector[fi & all.weight_mask]; float x_abs = fabs(fx); if( x_abs > w[all.normalized_idx] ) { if( w[all.normalized_idx] > 0. ) { @@ -74,7 +74,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_vectors[fi & all.weight_mask]; + weight* w = &all.reg.weight_vector[fi & all.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] ) { @@ -88,7 +88,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_vectors[fi & all.weight_mask]; + weight* w = &all.reg.weight_vector[fi & all.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] ) { @@ -125,7 +125,7 @@ void sd_cubic_update(vw& all, feature& f0, feature& f1, v_array<feature> cross_f } inline void upd_add(vw& all, float fx, uint32_t fi, float update) { - all.reg.weight_vectors[fi] += update * fx; + all.reg.weight_vector[fi] += update * fx; } |