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

Modifying the padding scheme #465

Open
joshnunley opened this issue Mar 19, 2022 · 3 comments
Open

Modifying the padding scheme #465

joshnunley opened this issue Mar 19, 2022 · 3 comments

Comments

@joshnunley
Copy link

I have an application where I would like to be able to control the padding for the convolution. The way I am doing this now is to just use a much larger matrix than I need, but this is a waste of computation, especially for larger kernels. Is there any simple and efficient way I can use my own padding?

@martinholters
Copy link
Member

I'm not completely sure what you'd like to have exactly. Could you elaborate?

@joshnunley
Copy link
Author

After thinking about it a bit more, I think what I would like is similar to the option mode='valid' in python (and I think matlab). This mode should be somewhat faster because it doesn't need to compute the convolution with any cells that would need padding.

@martinholters
Copy link
Member

IIUC, that means chopping off mix(M,N)-1 elements at both sides of the result as it is computed now, where M and N are the input lengths, with the obvious extension to more than one dimension. Sounds reasonable.

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

No branches or pull requests

3 participants