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

Ignore the NoUtterancesError when calculating pesq for a batch #2753

Merged
merged 15 commits into from
Oct 9, 2024

Conversation

veera-puthiran-14082
Copy link
Contributor

@veera-puthiran-14082 veera-puthiran-14082 commented Sep 17, 2024

What does this PR do?

Fixes #2752

  • Ignores the NoUtterancesError and create tensors with the available results, if a batch of size 32 is passed and 2 of them encountered an error, then for 30 pesq scores avg will be calculated and returned.

  • introduced a simple lambda function which filter out exception messages and keep the pesq values calculated.

  • since the np.array contained error messages and pesq scores, the result was in np.object dtype. it is converted to np.float32 since pesq is also calculated in float32

Checklist

  • Was this discussed/agreed 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.


📚 Documentation preview 📚: https://torchmetrics--2753.org.readthedocs.build/en/2753/

@veera-puthiran-14082 veera-puthiran-14082 changed the title Closes #2752 Ignores the NoUtterancesError when calculating pesq for a batch Sep 17, 2024
@veera-puthiran-14082 veera-puthiran-14082 changed the title Ignores the NoUtterancesError when calculating pesq for a batch Ignore the NoUtterancesError when calculating pesq for a batch Sep 17, 2024
@Borda Borda changed the title Ignore the NoUtterancesError when calculating pesq for a batch Ignore the NoUtterancesError when calculating pesq for a batch Sep 17, 2024
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35%. Comparing base (6226a53) to head (0831873).
Report is 1 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (6226a53) and HEAD (0831873). Click for more details.

HEAD has 72 uploads less than BASE
Flag BASE (6226a53) HEAD (0831873)
torch2.0.1+cpu 6 3
python3.10 10 5
Windows 5 3
cpu 37 20
torch1.11.0+cpu 2 1
Linux 26 13
python3.9 18 9
torch1.12.1+cpu 2 1
macOS 6 4
torch2.0.1 4 2
torch1.10.2+cpu 2 1
torch2.4.0+cpu 2 1
python3.11 5 3
python3.8 4 3
torch1.13.1+cpu 5 3
torch2.3.1+cpu 4 2
torch2.2.2+cpu 4 2
torch2.4.0+cu121 2 1
torch2.1.2+cpu 2 1
gpu 2 0
unittest 2 0
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #2753     +/-   ##
========================================
- Coverage      69%     35%    -34%     
========================================
  Files         329     316     -13     
  Lines       18079   17919    -160     
========================================
- Hits        12501    6291   -6210     
- Misses       5578   11628   +6050     

@mergify mergify bot added the ready label Sep 17, 2024
@veera-puthiran-14082
Copy link
Contributor Author

@Borda can this be merged ? Thanks in advance

@SkafteNicki SkafteNicki added the enhancement New feature or request label Oct 8, 2024
@SkafteNicki SkafteNicki added this to the v1.4.x milestone Oct 8, 2024
@Borda Borda requested a review from SkafteNicki October 8, 2024 17:28
@SkafteNicki SkafteNicki enabled auto-merge (squash) October 9, 2024 08:44
@SkafteNicki SkafteNicki merged commit 8cf181f into Lightning-AI:master Oct 9, 2024
62 checks passed
Borda pushed a commit that referenced this pull request Oct 9, 2024
* filter nan

* use np

* fix tests

* fix dtype from object

* as func

* typing

* changelog

---------

Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Nicki Skafte Detlefsen <skaftenicki@gmail.com>
Co-authored-by: Jirka B <j.borovec+github@gmail.com>

(cherry picked from commit 8cf181f)
Borda pushed a commit that referenced this pull request Oct 10, 2024
* filter nan

* use np

* fix tests

* fix dtype from object

* as func

* typing

* changelog

---------

Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Nicki Skafte Detlefsen <skaftenicki@gmail.com>
Co-authored-by: Jirka B <j.borovec+github@gmail.com>

(cherry picked from commit 8cf181f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PESQ No utterances detected
3 participants