add a general nxm convolution filter (a generalization of filter3x3)
This PR is a generalization of the filter3x3 and extends to odd shaped kernels of dimensions nxm.
Maybe we can just call it filter? 🤔
Although this is already inside a module called filter.
Or we can expose it to users as a Kernel method. clamped_filter, for example.
Sure, either works. What would be the prefernce?
Sure, either works. What would be the prefernce?
Let's ask the owner @theotherphil. Do you have any preferences or maybe some criticism of this pr?
The strange thing is that this only works for odd sizes. I have an implementation of 2d convolution in Rust via "Im2Col" and matrix multiplication (compatible with torch), and the kernels are of any size.
Thanks for the PR. I’m not sure about the filternxm function - filter3x3 exists mainly because it initially had a special cased implementation. I’d accept a PR to add a clamped_filter function to Kernel.