Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: SDR & SI_SDR #711

Merged
merged 12 commits into from
Jan 8, 2022
Merged

Refactor: SDR & SI_SDR #711

merged 12 commits into from
Jan 8, 2022

Conversation

Borda
Copy link
Member

@Borda Borda commented Jan 5, 2022

What does this PR do?

Unify the notation and keep more descriptive functional names
part of #729

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@codecov
Copy link

codecov bot commented Jan 5, 2022

Codecov Report

Merging #711 (fb39eb0) into master (2f32c2d) will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master   #711   +/-   ##
=====================================
  Coverage      95%    95%           
=====================================
  Files         166    166           
  Lines        6448   6465   +17     
=====================================
+ Hits         6137   6154   +17     
  Misses        311    311           

@Borda Borda self-assigned this Jan 5, 2022
@Borda Borda added this to the v0.7 milestone Jan 5, 2022
CHANGELOG.md Outdated Show resolved Hide resolved
@quancs
Copy link
Member

quancs commented Jan 5, 2022

@Borda why we need to rename SDR & SISDR? SDR and SISDR are both commonly used name in audio field. It's short and easy to type

@Borda
Copy link
Member Author

Borda commented Jan 5, 2022

SDR and SISDR are both commonly used name in audio field. It's short and easy to type

that is the point that they are common in audio, but then we import them in all metrics levels... 🐰
in fact, I am fine with SDR, but the SI is a bit confusing
my main concern is having _ in the class name is not pythonic and inconsistent with other metrics

@quancs
Copy link
Member

quancs commented Jan 5, 2022

that is the point that they are common in audio, but then we import them in all metrics levels... 🐰 in fact, I am fine with SDR, but the SI is a bit confusing my main concern is having _ in the class name is not pythonic and inconsistent with other metrics

Importing sdr and si_sdr in all metrics levels only make troubles when some other metrics have the same short name with them. After googling SDR, I can only find Special Drawing Rights (SDRs) , software defined Radio (SDR), Sales Development Representatives (SDRs) in the first three pages. If you think it's a confusing name, can you give some examples?

Below is the original definition of SI-SDR in paper.
图片
The - cannot be used, thus _ is used instead. I know it's not pythonic, but add a separator is the tradition in audio field. I can list many and many papers to demonstrate that.

@Borda
Copy link
Member Author

Borda commented Jan 5, 2022

@quancs first of all, it is not meant as any form of offense to audio metrics or lowering your contribution! I just try to find the best way for TorchMterics as a coherent package and have a consistent name convention...

as we have also MAPE, which is also most likely only one meaning, but we call it Mean absolute percentage error

@quancs
Copy link
Member

quancs commented Jan 5, 2022

@Borda I was a little bit hurry before. ^^
Removing the _ is OK for me. But I really don't like the idea to expand the names of audio metrics. The short names are unique, clear and concise in audio field.

@Borda Borda force-pushed the refactor/sdr branch 2 times, most recently from 29e71ff to 8285d95 Compare January 6, 2022 11:54
@Borda
Copy link
Member Author

Borda commented Jan 6, 2022

@PyTorchLightning/core-metrics updated and keeping abbreviations, pls check it now 🐰

@Borda Borda requested a review from justusschock January 6, 2022 14:25
@Borda Borda mentioned this pull request Jan 6, 2022
4 tasks
@Borda
Copy link
Member Author

Borda commented Jan 7, 2022

@quancs is there a reason why you are moving it back to separate files?
I thought that we (I suggested and you did not dispute #712 (comment)) agreed to have it in the same file

@Borda Borda mentioned this pull request Jan 7, 2022
12 tasks
@Borda Borda marked this pull request as draft January 7, 2022 09:55
@quancs
Copy link
Member

quancs commented Jan 7, 2022

@quancs is there a reason why you are moving it back to separate files? I thought that we (I suggested and you did not dispute #712 (comment)) agreed to have it in the same file

I remembered that you said you would go with 2 ( 2 put sisnr and sisdr together;), so ...

@quancs
Copy link
Member

quancs commented Jan 7, 2022

@Borda I thought that's our agreement ... So, you changed your mind? ^^

@quancs
Copy link
Member

quancs commented Jan 7, 2022

I'm OK with both choices. You can choose the anyone you like.

@quancs
Copy link
Member

quancs commented Jan 7, 2022

@Borda Another decision we need to make is about the full name of SDR and SNR. signal_to_noise_ratio or signal_noise_ratio? signal_to_distortion_ratio or signal_distortion_ratio? What do you think

@Borda
Copy link
Member Author

Borda commented Jan 7, 2022

@Borda Another decision we need to make is about the full name of SDR and SNR. signal_to_noise_ratio or signal_noise_ratio? signal_to_distortion_ratio or signal_distortion_ratio? What do you think

I would follow sklearn and skimage and drite it without _to_

I remembered that you said you would go with 2 ( 2 put sisnr and sisdr together;), so ...

I made typo, then fixed it, but in all conversations, I was saying to put sdr and si-sdr together as it rather a variant of sdr the si

I'm OK with both choices. You can choose the anyone you like.

lets stick with the resolution on metrics slack

@quancs
Copy link
Member

quancs commented Jan 7, 2022

@Borda Another decision we need to make is about the full name of SDR and SNR. signal_to_noise_ratio or signal_noise_ratio? signal_to_distortion_ratio or signal_distortion_ratio? What do you think

I would follow sklearn and skimage and drite it without _to_

I remembered that you said you would go with 2 ( 2 put sisnr and sisdr together;), so ...

I made typo, then fixed it, but in all conversations, I was saying to put sdr and si-sdr together as it rather a variant of sdr the si

I'm OK with both choices. You can choose the anyone you like.

lets stick with the resolution on metrics slack

OK. Agree.

@Borda Borda marked this pull request as ready for review January 8, 2022 10:49
@Borda Borda enabled auto-merge (squash) January 8, 2022 10:56
@mergify mergify bot added the ready label Jan 8, 2022
@Borda Borda disabled auto-merge January 8, 2022 19:33
@Borda Borda merged commit fdf5b3f into master Jan 8, 2022
@Borda Borda deleted the refactor/sdr branch January 8, 2022 19:33
Borda added a commit to AIMistakes/metrics that referenced this pull request Jan 10, 2022
* signal_distortion_ratio
* scale_invariant_signal_distortion_ratio
* SignalDistortionRatio
* ScaleInvariantSignalDistortionRatio

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API / design ready refactoring refactoring and code health
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants