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

Add epsilon for numerical stability.

parent 35954e18
No related branches found
No related tags found
No related merge requests found
...@@ -65,6 +65,9 @@ class BernoulliGammaLoss(NaNLoss): ...@@ -65,6 +65,9 @@ class BernoulliGammaLoss(NaNLoss):
mask = ~torch.isnan(y_true) mask = ~torch.isnan(y_true)
y_true = y_true[mask] y_true = y_true[mask]
# mask values less than 0
y_true[y_true < 0] = 0
# calculate true probability of precipitation: # calculate true probability of precipitation:
# 1 if y_true > min_amount else 0 # 1 if y_true > min_amount else 0
p_true = (y_true > self.min_amount).type(torch.float32) p_true = (y_true > self.min_amount).type(torch.float32)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment