pytensor icon indicating copy to clipboard operation
pytensor copied to clipboard

Add correlate1d 1

Open goldigd05 opened this issue 8 months ago • 4 comments

Description

Related Issue

  • [ ] Closes #
  • [ ] Related to #

Checklist

Type of change

  • [ ] New feature / enhancement
  • [ ] Bug fix
  • [ ] Documentation
  • [ ] Maintenance
  • [ ] Other (please specify):

goldigd05 avatar Mar 16 '26 23:03 goldigd05

Fixes #1321

Changes

  • Added correlate1d function using convolve1d with flipped input

Type of change

  • New feature / enhancement

goldigd05 avatar Mar 16 '26 23:03 goldigd05

@pre-commit-ci autofix

goldigd05 avatar Mar 16 '26 23:03 goldigd05

Do you have a use-case in mind for correlate? I'm inclined to not merge this because of how light the wrapper is. If you need it in a model you can just do pt.flip(pt.convolve1d(x)).

jessegrabowski avatar Mar 30 '26 11:03 jessegrabowski

I think it's just API compat, but it should be called correlate: https://numpy.org/doc/2.1/reference/generated/numpy.correlate.html.

Or from scipy correlate and correlate2d (they don't seem ho have correlate1d)

ricardoV94 avatar Mar 30 '26 12:03 ricardoV94