Skip to content

Conversation

@mrityunjai01
Copy link

  1. Added ’same’ mode in scipy.signal.convolve, (in orther words, a forward pass or a direct application of convolve)
  2. Added the vjp autograd function (backward or reverse differentiation)
  3. Added a test for ‘same’ mode forward pass.

This should make it straightforward to write an implementation for np.convolve covering all modes.
I claim that the VJP for convolve doesn't necessarily need to be composed of other defined primitives to make it infinitely differentiable. The second derivative of convolve is zero, with respect to either argument (Claim).

Remaining tasks:

  1. Add test to check for grad of convolve
  2. Add jvp for convolve

The changes are written to not touch the existing code for ‘valid’ and ‘full’ modes, while minimizing the ‘git diff’ in this commit.

Copy link
Collaborator

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @mrityunjai01! Were you able to get to writing the JVP for convolve and the tests? :)

@agriyakhetarpal agriyakhetarpal requested a review from fjosw October 19, 2025 16:10
@mrityunjai01
Copy link
Author

thanks, wondering if it makes more sense to include jvp in a separate PR

@agriyakhetarpal
Copy link
Collaborator

I think that should be fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants