Skip to content

Commit

Permalink
fix empirical noise model
Browse files Browse the repository at this point in the history
  • Loading branch information
andrefaure committed Jan 19, 2024
1 parent be5e7d0 commit a175cc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymochi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def forward(self, input: Tensor, target: Tensor, weight: Tensor) -> Tensor:

class MochiGaussianNLLLoss(torch.nn.GaussianNLLLoss):
"""
Mochi version of GaussianNLLLoss with no reduction that accepts weights (1/sigma) rather than var = sigma^2.
Mochi version of GaussianNLLLoss with no reduction that accepts fitness weights (1/sigma) rather than var = sigma^2.
"""
def forward(self, input: Tensor, target: Tensor, weight: Tensor) -> Tensor:
return F.gaussian_nll_loss(input, target, torch.pow(weight, -2), full = True, eps = 0, reduction = "none")
Expand Down

0 comments on commit a175cc5

Please sign in to comment.