Skip to content

Commit

Permalink
Fix normalize() to actually modify the gradients
Browse files Browse the repository at this point in the history
Picked up thanks to a clang warning.
  • Loading branch information
ojwb committed Jun 30, 2022
1 parent e8ee181 commit 313eca9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xapian-letor/ranker/listnet_ranker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ update_parameters(vector<double> &new_parameters, const vector<double> &gradient

static void
normalize(vector<double>& gradient, size_t size) {
for (auto item : gradient) {
for (auto& item : gradient) {
item /= size;
}
}
Expand Down

0 comments on commit 313eca9

Please sign in to comment.