Hi Tejan!



 Tejan_Mehndiratta:

Can anybody tell me how to code a Spatial Separable Convolution layer?


Unless I misunderstand your question, you can use two convolutions in
a row (without an intervening non-linear activation).
So if you want, say, a 5x5 separable convolution (with single channels):
conv15 = torch.nn.Conv2d (1, 1, (1, 5), bias = False)
conv51 = torch.nn.Conv2d (1, 1, (5, 1), bias = False)
y = conv51 (conv15 (x))

y is now x convolved with a separable 5x5 kernel.  (And as conv15
and conv51 are trained, their product will, of course, stay separable.)
Best.
K. Frank