-
Notifications
You must be signed in to change notification settings - Fork 75
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
Number of parameter changing when changing dilation #25
Comments
Hi @kinalmehta Thank for your question. The behaviour is not totally unexpected. As a short answer, you can try to pass the argument Here is the long answer: First of all, recall what a basis for the steerable filters looks like. See Figure 2 in https://arxiv.org/pdf/1711.07289.pdf The equivariant property only constraints the angular part of the filters but not the radial one. The perfect trade off for the number of frequencies to use in each ring is hard to estimate theoretically. The default parameters in R2Conv use our manually tuned trade-off, which works quite well for dense filters, but is not tuned for sparse filters like dilated ones. This is the reason why dilated filters have more parameters. I would actually recommend trying to use a stronger frequency cut-off when using dilated filters. Have a look at this answer, where I gave an a bit more detailed explaination of the parameters you need to tune: #18 (comment) In your case, when using diltation, the set of rings is computed as if the filter is not dilated and then the filters are scaled by the dilation; see this line. Does this make sense for you? Gabriele |
Hi @Gabri95 , Thanks for such a detailed answer. My steerable Convolution concepts are a bit week, but referring to the answer gave me a decent overview of why there are different number of parameters in the two case. I am using dilated convolution during evaluation and training the model using (max-pool+non-dilated) version. Thanks again |
hi @kinalmehta I am happy it was useful :) This is hard to tell a priori. However, you will probably observe some more noise when checking explicitly the rotation equivariance of the model. In any case, you can always try to experiment a bit with different bandlimiting of the filters to find a better trade-off for the smoothness of the filters (which reduces the equivariance error). If you find some interesting result, I'd be curious to hear about it so, please, let me know :) Best, |
I want to use R2Conv in atrous spatial pyramid pooling(ASPP), whose dilation is 12, 24, 36. But the result is very very pool. The code is as follows. Could you give some suggestions? conv3x3(in_dim, reduction_dim, dilation=r, padding=r)(r=12, 24, 36) |
Hi @purse1996 I think you may have some issue with the frequencies cutoff. If you use a 3x3 filter with dilation D, the outer pixels will have radius D.
However, keep in mind you filter is still very sparse, which also means that it will most likely not be very stable to continuous rotations (but should still be equivariant to 90 deg ones). Gabriele |
I happened to observe that when I change the dilation value, the number of parameters change. This is not the case with the standard torch.nn.Conv2D module. Is there any specific reason it happens in e2cnn.nn.R2Conv.
If this behaviour is expected, can you please direct me to the right resource.
Environment:
Code to reproduce issue
Output
The text was updated successfully, but these errors were encountered: