Skip to content
Snippets Groups Projects
Commit 292da406 authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Handle infinite values for Weibull.

parent 2ea890f8
No related branches found
No related tags found
No related merge requests found
......@@ -199,4 +199,5 @@ class BernoulliWeibullLoss(NaNLoss):
(gshape - 1) * torch.log(y_true + self.epsilon) -
(y_true / (gscale + self.epsilon)) ** gshape)
return self.reduce(loss)
# handle +-infinity values resulting from initialization
return self.reduce(loss[torch.isfinite(loss)])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment