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

Changed computation of Weibull NLL.

parent b870e4b4
No related branches found
No related tags found
No related merge requests found
...@@ -155,10 +155,9 @@ class BernoulliWeibullLoss(BernoulliLoss): ...@@ -155,10 +155,9 @@ class BernoulliWeibullLoss(BernoulliLoss):
# torch.pow(y_weib / (scale + self.epsilon), shape) # torch.pow(y_weib / (scale + self.epsilon), shape)
# ) # )
loss_weib = (torch.log(p_pred[~mask_p] + self.epsilon) + loss_weib = (torch.log(p_pred[~mask_p] + self.epsilon) +
torch.log(shape / (scale + self.epsilon)) - torch.log(shape / scale) -
(shape - 1) * torch.log(y_weib / (scale + self.epsilon)) - (shape - 1) * torch.log(y_weib / scale) -
torch.pow(y_weib / (scale + self.epsilon), shape) torch.pow(y_weib / scale, shape))
)
# fill loss array # fill loss array
loss[torch.where(mask_p)] = - loss_bern loss[torch.where(mask_p)] = - loss_bern
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment