Skip to content

Commit

Permalink
update SISNR doc to make it clear we display minus the SISNR (#268)
Browse files Browse the repository at this point in the history
* doc

* making doc clearer

* line too long
  • Loading branch information
adefossez authored Sep 7, 2023
1 parent 3dea2b9 commit 80def9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions audiocraft/losses/sisnr.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class SISNR(nn.Module):
Input should be [B, C, T], output is scalar.
..Warning:: This function returns the opposite of the SI-SNR (e.g. `-1 * regular_SI_SNR`).
Consequently, lower scores are better in terms of reconstruction quality,
in particular, it should be negative if training goes well. This done this way so
that this module can also be used as a loss function for training model.
Args:
sample_rate (int): Sample rate.
segment (float or None): Evaluate on chunks of that many seconds. If None, evaluate on
Expand Down
4 changes: 4 additions & 0 deletions docs/METRICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ We provide an implementation of the Scale-Invariant Signal-to-Noise Ratio in PyT
No specific requirement is needed for this metric. Please activate the metric at the
evaluation stage with the appropriate flag:

**Warning:** We report the opposite of the SI-SNR, e.g. multiplied by -1. This is due to internal
details where the SI-SNR score can also be used as a training loss function, where lower
values should indicate better reconstruction. Negative values are such expected and a good sign! Those should be again multiplied by `-1` before publication :)

```shell
dora run <...> evaluate.metrics.sisnr=true
```
Expand Down

0 comments on commit 80def9c

Please sign in to comment.