shamoons:

is there any advantage to doing a “depth wise separable convolution”? It seems then the contextual information from the other channels won’t be factored in.


I can’t give you a general answer, as the advantages/disadvantages will depend on your actual use case.
For your use case to get the identical output, you would need to use a depthwise convolution, otherwise the input channels will be summed.



 shamoons:

This still doesn’t quite get it:


You are most likely getting a different result due to the bias.
Here is an example yielding the same result:
conv = nn.Conv1d(5, 5, kernel_size=11, stride=1, padding=5, groups=5, bias=False)
with torch.no_grad():
    conv.weight.zero_()
    conv.weight[:, :, 5] = 1.

x = torch.randn(2, 5, 24)
out = conv(x)
print((out == x).all())
> tensor(True)




 shamoons:

What is input(Ni, k)?


N_i is used to index the batch dimension, while k is used to index the input channel dimension.
Have a look at CS231n - Convolution for a detailed description about the shape and workflow of convolutions. While the post is focused on 2D convolutions, the general method also applies for 1D convs.