Skip to content

Commit

Permalink
sync for init score of binary objective function (#4332)
Browse files Browse the repository at this point in the history
Co-authored-by: 未闲 <[email protected]>
  • Loading branch information
loveclj and 未闲 authored Jun 25, 2021
1 parent 113b44d commit 0701a32
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/objective/binary_objective.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ class BinaryLogloss: public ObjectiveFunction {
suml += is_pos_(label_[i]);
}
}
if (Network::num_machines() > 1) {
suml = Network::GlobalSyncUpBySum(suml);
sumw = Network::GlobalSyncUpBySum(sumw);
}
double pavg = suml / sumw;
pavg = std::min(pavg, 1.0 - kEpsilon);
pavg = std::max<double>(pavg, kEpsilon);
Expand Down

0 comments on commit 0701a32

Please sign in to comment.