Skip to content

Commit

Permalink
fix off by 1 potentially affecting optimal hyperparams
Browse files Browse the repository at this point in the history
see 2013 discussion: clab#4
  • Loading branch information
graehl committed Jan 29, 2025
1 parent b3a83fe commit 3ebcb88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fast_align.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ void UpdateFromPairs(const vector<string>& lines, const int lc, const int iter,
for (unsigned i = 1; i <= src.size(); ++i) {
const double p = probs[i] / sum;
s2t->Increment(src[i - 1], f_j, p);
emp_feat_ += DiagonalAlignment::Feature(j, i, trg.size(), src.size()) * p;
emp_feat_ += DiagonalAlignment::Feature(j + 1, i, trg.size(), src.size()) * p;
}
}
local_likelihood += log(sum);
Expand Down

0 comments on commit 3ebcb88

Please sign in to comment.