diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2011-04-22 13:38:32 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2011-04-22 13:38:32 -0400 |
commit | 9d393298ce21159907884ea9b7318c52585409ee (patch) | |
tree | cab034a01642abb2a067818f9c8f29999c4c6797 /training/mr_em_adapted_reduce.cc | |
parent | b6634dff2cd515d9e6f95416512db893a08bde29 (diff) |
make compatible with FastSparseVector
Diffstat (limited to 'training/mr_em_adapted_reduce.cc')
-rw-r--r-- | training/mr_em_adapted_reduce.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/training/mr_em_adapted_reduce.cc b/training/mr_em_adapted_reduce.cc index 29416348..d4c16a2f 100644 --- a/training/mr_em_adapted_reduce.cc +++ b/training/mr_em_adapted_reduce.cc @@ -53,7 +53,7 @@ void Maximize(const bool use_vb, const SparseVector<double>& counts = *pc; if (use_vb) - assert(total_event_types >= counts.num_active()); + assert(total_event_types >= counts.size()); double tot = 0; for (SparseVector<double>::const_iterator it = counts.begin(); @@ -73,7 +73,7 @@ void Maximize(const bool use_vb, } } #if 0 - if (counts.num_active() < 50) { + if (counts.size() < 50) { for (SparseVector<double>::const_iterator it = counts.begin(); it != counts.end(); ++it) { cerr << " p(" << FD::Convert(it->first) << ")=" << exp(it->second); @@ -112,7 +112,7 @@ int main(int argc, char** argv) { if (cur_key.size() > 0) { // TODO shouldn't be num_active, should be total number // of events - Maximize(use_vb, alpha, acc.num_active(), &acc); + Maximize(use_vb, alpha, acc.size(), &acc); cout << cur_key << '\t'; if (use_b64) B64::Encode(0.0, acc, &cout); @@ -159,7 +159,7 @@ int main(int argc, char** argv) { } // TODO shouldn't be num_active, should be total number // of events - Maximize(use_vb, alpha, acc.num_active(), &acc); + Maximize(use_vb, alpha, acc.size(), &acc); cout << cur_key << '\t'; if (use_b64) B64::Encode(0.0, acc, &cout); |