Spaces:
Sleeping
Sleeping
Commit
·
fb92c76
1
Parent(s):
9216427
Negate sisdr
Browse files- remfx/models.py +6 -1
remfx/models.py
CHANGED
@@ -67,9 +67,14 @@ class RemFXModel(pl.LightningModule):
|
|
67 |
x, y, label = batch
|
68 |
# Metric logging
|
69 |
for metric in self.metrics:
|
|
|
|
|
|
|
|
|
|
|
70 |
self.log(
|
71 |
f"{mode}_{metric}",
|
72 |
-
self.metrics[metric](output, y),
|
73 |
on_step=False,
|
74 |
on_epoch=True,
|
75 |
logger=True,
|
|
|
67 |
x, y, label = batch
|
68 |
# Metric logging
|
69 |
for metric in self.metrics:
|
70 |
+
# SISDR returns negative values, so negate them
|
71 |
+
if metric == "SISDR":
|
72 |
+
negate = -1
|
73 |
+
else:
|
74 |
+
negate = 1
|
75 |
self.log(
|
76 |
f"{mode}_{metric}",
|
77 |
+
negate * self.metrics[metric](output, y),
|
78 |
on_step=False,
|
79 |
on_epoch=True,
|
80 |
logger=True,
|