-
Notifications
You must be signed in to change notification settings - Fork 36
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
SWT: Make circular padding wrap more than once if needed #84
Conversation
Thank you for the review @cthoyt ! I added explainig comments and some tests comparing the function with numpys wrap padding. |
I see failed tests on my machine:
|
a partial log from |
@v0lta we need to update this line
|
Done in the main branch. |
TODO: Port shape fold-unfolding code to swt, properly. |
Sorry, I forgot to mention that I added test cases that weren't covered yet. Specifically, since I am working with 1-dimensional signals, I added cases with |
Thanks @NiclasPi . I have a fix in https://github.com/v0lta/PyTorch-Wavelet-Toolbox/tree/fix-padding which starts to address this. We currently get (1, T) outputs shapes for (N,) inputs across the entire toolbox. With N, the input measurements and T for the dimension at some transform level. This is not what we want since the Toolbox should always respect the uses choice of input dimension. I will fix this across the board. |
It's not a catastrophic problem users can currently fix this by running out.squeeze() themselves, but since we want to be pywt-compatible the shapes should be identical, so we'll fix this. |
you need to add the remote (see https://docs.github.com/en/get-started/getting-started-with-git/managing-remote-repositories) git remote add NiclasPi https://github.com/NiclasPi/PyTorch-Wavelet-Toolbox.git
git fetch --all then you can switch to the right fix-padding branch |
Thanks @cthoyt ! I think we are almost there now. The last thing I would like to do here ist get rid of |
Hi Team, I removed the |
Some combinations of wavelets and number of decomposition steps cause the following
RuntimeError
: "Padding value causes wrapping around more than once".If the padding values are greater than the input length,
torch.nn.functional.pad
does not wrap around more than once in circluar mode. We need to manually wrap around more than once, if needed. See feature request https://github.com/pytorch/pytorch/issues/57911 in PyTorch.