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

Fix amplitude_to_DB numerical instability #611

Closed
mthrok opened this issue May 5, 2020 · 4 comments
Closed

Fix amplitude_to_DB numerical instability #611

mthrok opened this issue May 5, 2020 · 4 comments
Assignees

Comments

@mthrok
Copy link
Collaborator

mthrok commented May 5, 2020

Recently we discovered that torch.log10 behaves differently on different CPUs when the input tensor is float32. pytorch/pytorch#37833 Note: This is not a random behavior.

Due to this, we have some tests that passes on some machines but fail on other machines.
A proposed fix for this is to use float64 type before passing the tensor to torch.log10 here, and convert back to float32 if the input type was float32

Once this is completed, we could re-enable the following tests;

  1. librosa_compatibility_test
  2. test_batch_consistency

For 2. See the commit b499840 and revert the atol to 1e-5.

You can run these test with the following commands;

pytest test -v -k batch_mfcc
pytest test -v -k basics3

In addition to that, all the existing test that uses amplitude_to_DB, should pass.

pytest test -v -k amplitude_to_DB
@Micheladar
Copy link

I'll work on it.

@kshitij12345
Copy link
Contributor

@Micheladar Hi, are you working on it?

@discort
Copy link
Contributor

discort commented Feb 28, 2021

@mthrok
Is still relevant issue? If so, could you please update the description. It seems there are no mentioned tests

@mthrok
Copy link
Collaborator Author

mthrok commented Apr 16, 2021

Resolved via #1436 #1439

@kshitij12345 @discort sorry for not responding earlier. The test has been refactored and refined. This issue is no longer relevant.

@mthrok mthrok closed this as completed Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants