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

Changed computation of Weibull NLL.

parent aa5e72b8
No related branches found
No related tags found
No related merge requests found
......@@ -148,10 +148,15 @@ class BernoulliWeibullLoss(BernoulliLoss):
loss_bern = torch.log(1 - p_pred[mask_p] + self.epsilon)
# Weibull contribution
# loss_weib = (torch.log(p_pred[~mask_p] + self.epsilon) +
# torch.log(shape + self.epsilon) -
# shape * torch.log(scale + self.epsilon) +
# (shape - 1) * torch.log(y_weib + self.epsilon) -
# torch.pow(y_weib / (scale + self.epsilon), shape)
# )
loss_weib = (torch.log(p_pred[~mask_p] + self.epsilon) +
torch.log(shape + self.epsilon) -
shape * torch.log(scale + self.epsilon) +
(shape - 1) * torch.log(y_weib + self.epsilon) -
torch.log(shape / (scale + self.epsilon)) -
(shape - 1) * torch.log(y_weib / (scale + self.epsilon)) -
torch.pow(y_weib / (scale + self.epsilon), shape)
)
......
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