-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add support for non-zero padding #438
Conversation
@@ -181,6 +182,7 @@ def __init__( | |||
kernel_size, | |||
strides=1, | |||
padding="valid", | |||
pad_values=0.0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@larq/core how do you feel about pad_values
vs padding_values
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with either, no particular preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From an initial look this LGTM, but given how complex it is I think another few sets of eyes would be useful. CC @Tombana, given your experience with padding, can you take a look?
a1f1522
to
2057892
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I'd say pad_value
(singular) makes slightly more sense but since the tf op also uses it in plural form I think this is good.
2057892
to
c00da9b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Only thing is I would prefer to test whether the layer actually uses non-zero padding (if I'm correct the test would now pass even if _is_native_padding()
always returns True
)
Good point. I added a check to make sure |
This adds support for non zero padding for
QuantConv1D
,QuantConv2D
,QuantConv3D
,QuantDepthwiseConv2D
,QuantSeparableConv1D
andQuantSeparableConv2D
in order to better support larq/compute-engine#252We can add support for locally connected layers and transposed convolutions in the future.