I would like to perform a 1D Depthwise convolution (ie the first step of the depthwise-separable convolution) for a machine learning model I am working on. This means that for an input activation space of h x w, there are h kernels, each 1xk, where k is the length of the kernel (see attached figure).
This is not currently offered by Keras, but one can use the available Depthwise 2D convolution (which operates on 3D inputs), and simply add an extra dimension to the 2D inputs, and permute such that the original 2D height will span the channels of the new 3D activation space (see figure). The model report, showing these dimensions and permutations is below (the format for the Depthwise layer is "channels first").
However, I do not seem to be able to mimic this behaviour in a matlab golden model which uses the same input activation space and kernels. Does this method of using a Depthwise Conv2D to operate like a Depthwise Conv 1D make fundamental sense, or practical sense with keras, or am I missing something with the channel permutations perhaps?