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

Add optimized 1D and 2D convolution #109

Open
2 tasks
20akshay00 opened this issue Oct 6, 2024 · 2 comments
Open
2 tasks

Add optimized 1D and 2D convolution #109

20akshay00 opened this issue Oct 6, 2024 · 2 comments
Labels
optimization Something that optimizes size, speed, or maintainability.

Comments

@20akshay00
Copy link
Contributor

20akshay00 commented Oct 6, 2024

An analogue of scipy.signal.convolve2d would be extremely useful to simulate the following classes of models for example:

  1. Cellular automata, where we typically perform computations based on the neighbours of a cell. The SIRS demo is currently held back due to this.

  2. 2D Differential equations, where we need to apply a Laplacian operation which manifests as a convolution on a discrete grid. Alternatively, this can be implemented through matrix multiplication also.

  3. Image processing of course.

Perhaps a case can be made that this is a fairly specialized function similar to a fft or quadgk, etc. Whether it is general enough to warrant addition into NumDot or if these things must be maintained in a separate SciDot project is up for discussion.

ToDo

  • 1D convolutions
  • 2D convolutions
@Ivorforce Ivorforce added the feature New feature or request label Oct 6, 2024
@Ivorforce
Copy link
Owner

At the same time, we can probably also add convolve1d. NumPy has it too, and xtensor at least has an implementation for 1D convolutions (even if it's a bit... manual).

@Ivorforce
Copy link
Owner

With #110 implemented, 2D and 1D convolutions are already possible. Explicitly 2D and 1D convolutions should still be implemented since they're the most common by far, and are likely to benefit from optimization.

@Ivorforce Ivorforce added optimization Something that optimizes size, speed, or maintainability. and removed feature New feature or request labels Oct 13, 2024
@Ivorforce Ivorforce changed the title Add 2D convolution Add optimized 1D and 2D convolution Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Something that optimizes size, speed, or maintainability.
Projects
None yet
Development

No branches or pull requests

2 participants