Repository navigation
Adding scipy.signal.convolve and correlate functions - #3748
Conversation
|
I decided to add |
|
I have written most of the tests and in doing so found a bug in scipy: scipy/scipy#12686. I will avoid testing against that situation for now. |
|
This PR would end up closing #1639 (which asks for the 4 functions this PR adds). |
|
Not that complex types apparently aren't working as well as I thought. Simple cases with complex do work, but any random matrix doesn't. Working on that issue now. |
|
pfnCI, test this please. |
|
Jenkins CI test (for commit ccc00ca, target branch master) succeeded! |
|
Would you add the reference entries in |
takagi
left a comment
There was a problem hiding this comment.
Thanks! Would you check some comments?
| } | ||
| boundary = _boundaries.get(boundary) | ||
| if boundary is None: | ||
| raise ValueError("Acceptable boundary flags are 'fill' (or 'pad'), " |
There was a problem hiding this comment.
Why not fill, wrap and symm only here?
There was a problem hiding this comment.
This mimics the scipy error message which includes the un-documented acceptable boundary flags.
|
pfnCI, test this please. |
|
Jenkins CI test (for commit 0e12feb, target branch master) succeeded! |
This adds multidimensional
cupyx.scipy.signal.convolve()andcorrelate()functions. These simply map to thendimagefunctions (which were recently prepared for this with added support for thefullandvalidmodes natively without doing any extra padding).For the moment these functions aren't very useful since by default
method='auto'andchoose_conv_method()always returns'fft'which isn't in this PR. However,method='direct'is fully supported (including complex types even though #3705 isn't resolved since it doesn't use_run_1d_correlates()).I also have the code ready to submit for
fftconvolve()andchoose_conv_method()which I will create a PR for after this one is accepted (they are a bit intertwined, easier to separate this one out than that one). After that, I haveconvolve2,correlate2,oaconvolveall ready to go as well.This will need some minor rebasing after #3743 is merged. Additionally, I will update this PR in the next day or two with tests (have done informal tests and they all worked).