diff options
author | John Langford <jl@humpty.(none)> | 2010-09-24 23:58:29 +0400 |
---|---|---|
committer | John Langford <jl@humpty.(none)> | 2010-09-24 23:58:29 +0400 |
commit | 7e7cc9dd14650570002179c816a4af9eeb907fd6 (patch) | |
tree | 431b97171d2b22dda7a7abcdffa40ac07b812222 /cache.cc | |
parent | db4fc53a3271ac88d29e88c204367703c22c072c (diff) |
optimizations for speed
Diffstat (limited to 'cache.cc')
-rw-r--r-- | cache.cc | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -76,6 +76,7 @@ int read_cached_features(parser* p, void* ec) c+= sizeof(index); push(ae->indices, (size_t)index); v_array<feature>* ours = ae->atomics+index; + float* our_sum_feat_sq = ae->sum_feat_sq+index; size_t storage = *(size_t *)c; c += sizeof(size_t); p->input->set(c); @@ -101,6 +102,7 @@ int read_cached_features(parser* p, void* ec) f.x = *(float *)c; c += sizeof(float); } + *our_sum_feat_sq += f.x*f.x; size_t diff = f.weight_index >> 2; int32_t s_diff = ZigZagDecode(diff); if (s_diff < 0) |