Skip to content

Commit

Permalink
add catch for failing code
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbkoch committed Jan 26, 2025
1 parent e87e320 commit 5146aa5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions shared/libebm/PartitionOneDimensionalBoosting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,11 @@ template<bool bHessian, size_t cCompilerScores> class PartitionOneDimensionalBoo
EBM_ASSERT(std::isnan(gainParent) || 0 <= gainParent);

const FloatCalc gain = gainMissing + gainNonMissing - gainParent;
if (gain < 0.0) {
printf("GARBAGAGA: %e, %e, %e, %e\n", gain, gainMissing, gainNonMissing, gainParent);
exit(1);
}

totalGain += gain;

++iScore;
Expand Down

0 comments on commit 5146aa5

Please sign in to comment.