Hello,
Thank you @iKintosh for providing your code.
I'm currently trying to use your layer in my code (with torch 1.1.0) and I ran into some minor problems
I think the following lines should be updated in your code but I'm not sure so I decided to just point them out here :
1- Line 19 -> padding_mode
should be added
super(GaborSmallConv2d, self).__init__(in_channels, out_channels, kernel_size, stride, padding, dilation, False, _pair(0), groups, bias, padding_mode='zeros')
2- Line 24 -> .type(torch.Tensor)
should be added to make learnable parameter floating
self.theta = nn.Parameter(0.628*torch.randint(0, 6, (out_channels, in_channels)).type(torch.Tensor))
3- Line 62 -> same as #1
super(GaborConv2d, self).__init__(in_channels, out_channels, kernel_size, stride, padding, dilation, False, _pair(0), groups, bias, padding_mode='zeros')
4- Line 72 -> second parameter for meshgrid should be self.x0-1
not self.x0
(??)
y, x = torch.meshgrid([torch.linspace(-self.x0+1, self.x0, self.kernel_size[0]), torch.linspace(-self.y0+1, self.y0, self.kernel_size[1])])
5- Line 105 -> same as #1
super(GaborCurvedConv2d, self).__init__(in_channels, out_channels, kernel_size, stride, padding, dilation, False, _pair(0), groups, bias, padding_mode='zeros')