Skip to content

Commit

Permalink
making doc clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
adefossez committed Sep 7, 2023
1 parent 3c8c1d0 commit 5e935bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions audiocraft/losses/sisnr.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ class SISNR(nn.Module):
Input should be [B, C, T], output is scalar.
..Warning:: We report here minus SISNR, so negative values are better. This is so that
this can be naturally used as a loss!
..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.
Expand Down
4 changes: 3 additions & 1 deletion docs/METRICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ 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:** As we also allow SISNR to be used as a training loss, we actually report minus the SISNR, e.g. negative values are best.
**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 5e935bc

Please sign in to comment.