Skip to content

Commit

Permalink
Update stabilize_derivative
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander März committed Aug 28, 2023
1 parent 923e11e commit b3e83a9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lightgbmlss/distributions/mixture_distribution_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,13 @@ def stabilize_derivative(self, input_der: torch.Tensor, type: str = "MAD") -> to
div = torch.where(div > torch.tensor(10000.0), torch.tensor(10000.0), div)
stab_der = input_der / div

if type == "None":
stab_der = torch.nan_to_num(input_der,
nan=float(torch.nanmean(input_der)),
posinf=float(torch.nanmean(input_der)),
neginf=float(torch.nanmean(input_der))
)

return stab_der

def dist_select(self,
Expand Down

0 comments on commit b3e83a9

Please sign in to comment.