-
Notifications
You must be signed in to change notification settings - Fork 197
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
Feature Request: More padding mode. #994
Comments
I think it should be relatively straightforward to implement your own padding mode. brevitas/src/brevitas/nn/quant_conv.py Lines 200 to 205 in 2004568
in order to call your custom padding mode. As long as you call torch.nn.functional.conv2d (or 1d, etc.) with the input/weight/bias tensor that are passed to |
If you think that this feature could be beneficial for others and are willing to contribute to Brevitas, we would be more than happy to accept a PR. |
Sure, I will try to make a PR later ;) |
Closing this now. Feel free to re-open if you need more help! |
In many applications we want to make sure that the padding alters the local feature structure and global statistics the least (e.g. Image-to-image translation). Using zero padding in these applications will result in peaking edges[1][2].
However, only zero padding is supported by brevitas by now. I wonder is it possible to also support other padding mode like reflection or symmetric padding in brevitas? or is there a workaround?
[1] https://arxiv.org/abs/1703.10593
[2] https://arxiv.org/abs/1811.11718
The text was updated successfully, but these errors were encountered: