Skip to content

`conv2()` and `conv()`

Ryan Curtin requested to merge rcurtin/bandicoot-code:conv into unstable

It took me way longer than I had hoped to implement conv2(). The strategy I took is related to the standard im2col strategy for CNNs, but, since we are only doing a single 2D convolution (unlike the CNN case where we are doing numerous 2D convolutions simultaneously), the speedup may not be as significant as it would otherwise be.

This does wildly outperform the basic convolution implementation in Armadillo (not surprising given that it is labeled as "rudimentary"). In fact, all this depends on is subview operations and GEMVs, so it would be possible to take this implementation almost line-for-line and port it into Armadillo.

This MR also implements conv(), using the code for conv2() plus a little glue.

Edited by Ryan Curtin

Merge request reports