summaryrefslogtreecommitdiff
path: root/rst_parser/rst_train.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cab.ark.cs.cmu.edu>2012-06-18 20:42:27 -0400
committerChris Dyer <cdyer@cab.ark.cs.cmu.edu>2012-06-18 20:42:27 -0400
commitb89da66b5bc922148cb4ec2b30cc751c827c9f64 (patch)
treeed0734c6b944c6bcc53c3a4a2847add8c036d1bc /rst_parser/rst_train.cc
parent67456f9f7af754750faeea6f1e66b14b910d8751 (diff)
fixes for non-const iterator
Diffstat (limited to 'rst_parser/rst_train.cc')
-rw-r--r--rst_parser/rst_train.cc4
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;