New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R2Conv breaks with kernel_size=2 (list index out of range) #18
Comments
Hi @mpaepper, Thanks! While 2x2 convolutional filters are supported, they are not really stable to continuous rotations. I tuned manually this method a long time ago and it works pretty well for odd size filters and with larger even size filters. I definetly need to handle this kind of error better. I will add more informative error messages and I will raise it at initialization of the model. If you have to use 2x2 filters, here are a few more details about what is going on and a few suggestions. The 2x2 filter can be useful if you only care about equivariance to 90 degrees rotations (i.e. A steerable filter is in general split in multiple rings, see Figure 2 in https://arxiv.org/pdf/1711.07289.pdf A 2x2 grid is represented as 4 points at coordinates (-1/2, -1/2), (1/2, -1/2), (1/2, 1/2) and (-1/2, 1/2), where the rings are evaluated. You can fix this by either choosing a larger value of conv = nn.R2Conv(in_type, out_type, kernel_size=2, initialize=False, padding=0, sigma=0.2) As long as Otherwise, you can also choose conv = nn.R2Conv(in_type, out_type, kernel_size=2, initialize=False, padding=0, rings=[0.7], frequencies_cutoff=1.5) Hope this helps! Let me know if you have more questions Gabriele |
Thank you Gabriele, I really appreciate the detailed explanation and have a better understanding now, so I can make some experiments. |
Nice, I am happy this was helpful! |
This looks like a really nice library and I want to test it out, so I am converting an existing neural network to a rotational invariant one.
In one of my layers, I have a convolution with kernel_size=2. This breaks in the R2Conv while kernel_size=3 or more works fine.
Is there a reason why a kernel_size=2 convolution cannot work in the rotational setting or is this a bug?
Minimal example:
Error:
list index out of range in basisexpansion_blocks.py in line 327
The text was updated successfully, but these errors were encountered: