Add QDepthwiseConv2D, DepthwiseConv2D, DepthwiseConv1D support
Created by: jmitrevs
Description
There was a request to add support for QDepthwiseConv2D
for QKeras. Previously we had Keras support for DepthwiseConv1D
and DepthwiseConv2D
but only as part of separable convolutions. This PR adds support for standalone DepthwiseConv1D
and DepthwiseConv2D
, and also QDepthwiseConv2D
. Currently only depth_multiplier=1
is supported.
Note that QKeras doesn't support QDepthwiseConv1D
.
Adding this found an issue in that arguments to activations passed as parameters to, e.g. QDense
, such as activation='quantized_relu(3, 0)'
, were ignored. This had the same effect as activation='quantized_relu()'
.
Type of change
-
Bug fix (non-breaking change that fixes an issue) -
New feature (non-breaking change which adds functionality)
Tests
Tests added to both test_keras_api.py
and test_qkeras.py
Checklist
-
I have read the guidelines for contributing. -
I have commented my code, particularly in hard-to-understand areas. -
I have made corresponding changes to the documentation. -
My changes generate no new warnings. -
I have installed and run pre-commit
on the files I edited or added. -
I have added tests that prove my fix is effective or that my feature works.