From d5b17f37458563b75ba2cb8a3b45060db3d0a447 Mon Sep 17 00:00:00 2001 From: shahules786 Date: Mon, 14 Nov 2022 10:51:26 +0530 Subject: [PATCH] negate --- enhancer/loss.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enhancer/loss.py b/enhancer/loss.py index 75527bb..9955efd 100644 --- a/enhancer/loss.py +++ b/enhancer/loss.py @@ -192,7 +192,7 @@ class Si_snr(nn.Module): super().__init__() self.loss_fun = ScaleInvariantSignalNoiseRatio(**kwargs) - self.higher_better = True + self.higher_better = False self.name = "si_snr" def forward(self, prediction: torch.Tensor, target: torch.Tensor): @@ -203,7 +203,7 @@ class Si_snr(nn.Module): got {prediction.size()} and {target.size()} instead""" ) - return self.loss_fun(prediction, target) + return -1 * self.loss_fun(prediction, target) LOSS_MAP = {