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

Merge branch 'master' of gitlab.inf.unibz.it:REMSEN/climax

parents 49d32d5e 98ce5be8
No related branches found
No related tags found
No related merge requests found
......@@ -85,13 +85,13 @@ class BernoulliGammaLoss(NaNLoss):
# negative log-likelihood function of Bernoulli-Gamma distribution
# Bernoulli contribution
loss = (1 - p_true) * torch.log(1 - p_pred + self.epsilon)
loss = - (1 - p_true) * torch.log(1 - p_pred + self.epsilon)
# Gamma contribution
loss += p_true * (torch.log(p_pred + self.epsilon) + (gshape - 1) *
loss -= p_true * (torch.log(p_pred + self.epsilon) + (gshape - 1) *
torch.log(y_true + self.epsilon) -
y_true / (gscale + self.epsilon) -
gshape * torch.log(gscale + self.epsilon) -
torch.lgamma(gshape + self.epsilon))
return - self.reduce(loss)
return self.reduce(loss)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment