diff options
author | Chris Dyer <cdyer@cab.ark.cs.cmu.edu> | 2012-06-18 20:42:27 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cab.ark.cs.cmu.edu> | 2012-06-18 20:42:27 -0400 |
commit | 6d7219c6091e4dd1b6434bc6ec0645a3282d4883 (patch) | |
tree | cf6f992779d586c1f9845e32ee4a4a3236bea548 /rst_parser/rst_train.cc | |
parent | b89a1d3cb72ac36c137d6ae342f48ab9b8ee6655 (diff) |
fixes for non-const iterator
Diffstat (limited to 'rst_parser/rst_train.cc')
-rw-r--r-- | rst_parser/rst_train.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rst_parser/rst_train.cc b/rst_parser/rst_train.cc index 9b730f3d..a8b8dd84 100644 --- a/rst_parser/rst_train.cc +++ b/rst_parser/rst_train.cc @@ -126,12 +126,12 @@ int main(int argc, char** argv) { u.logeq(tot_feats.dot(weights)); prob_t w = u / q; zhat += w; - for (SparseVector<double>::const_iterator it = tot_feats.begin(); it != tot_feats.end(); ++it) + for (SparseVector<double>::iterator it = tot_feats.begin(); it != tot_feats.end(); ++it) sampled_exp.add_value(it->first, w * prob_t(it->second)); } sampled_exp /= zhat; SparseVector<double> tot_m; - for (SparseVector<prob_t>::const_iterator it = sampled_exp.begin(); it != sampled_exp.end(); ++it) + for (SparseVector<prob_t>::iterator it = sampled_exp.begin(); it != sampled_exp.end(); ++it) tot_m.add_value(it->first, it->second.as_float()); //cerr << "DIFF: " << (tot_m - corpus[i].features) << endl; const double eta = 0.03; |