Add kwarg and documentation for dilation_rate to SeparableConvs
* Add kwarg and documentation for dilation_rate to SeparableConvs
* Fix pep8 complaint
I forgot to check the style before committing. Pep8 was complaining about a missing whitespace after comma, now it's fixed.
@@ -1084,6 +1084,12 @@ class _SeparableConv(_Conv):
It defaults to the `image_data_format` value found in your
Keras config file at `~/.keras/keras.json`.
If you never set it, then it will be "channels_last".
+ dilation_rate: an integer or tuple/list of n integers, specifying
+ the dilation rate to use for dilated convolution.
+ Can be a single integer to specify the same value for
+ all spatial dimensions.
+ Currently, specifying any `dilation_rate` value != 1 is
+ incompatible with specifying any stride value != 1.
depth_multiplier: The number of depthwise convolution output channels
for each input channel.
The total number of depthwise convolution output
@@ -1139,6 +1145,7 @@ class _SeparableConv(_Conv):
strides=1,
padding='valid',
data_format=None,
+ dilation_rate=1,
depth_multiplier=1,
activation=None,
use_bias=True,
@@ -1160,6 +1167,7 @@ class _SeparableConv(_Conv):
strides=strides,
padding=padding,
data_format=data_format,
+ dilation_rate=dilation_rate,
activation=activation,
use_bias=use_bias,
bias_regularizer=bias_regularizer,
@@ -1293,6 +1301,10 @@ class SeparableConv1D(_SeparableConv):
It defaults to the `image_data_format` value found in your
Keras config file at `~/.keras/keras.json`.
If you never set it, then it will be "channels_last".
+ dilation_rate: An integer or tuple/list of a single integer, specifying
+ the dilation rate to use for dilated convolution.
+ Currently, specifying any `dilation_rate` value != 1 is
+ incompatible with specifying any `strides` value != 1.
depth_multiplier: The number of depthwise convolution output channels
for each input channel.
The total number of depthwise convolution output
@@ -1347,6 +1359,7 @@ class SeparableConv1D(_SeparableConv):
strides=1,
padding='valid',
data_format=None,
+ dilation_rate=1,
depth_multiplier=1,
activation=None,
use_bias=True,
@@ -1368,6 +1381,7 @@ class SeparableConv1D(_SeparableConv):
strides=strides,
padding=padding,
data_format=data_format,
+ dilation_rate=dilation_rate,
depth_multiplier=depth_multiplier,
activation=activation,
use_bias=use_bias,
@@ -1422,6 +1436,10 @@ class SeparableConv2D(_SeparableConv):
It defaults to the `image_data_format` value found in your
Keras config file at `~/.keras/keras.json`.
If you never set it, then it will be "channels_last".
+ dilation_rate: An integer or tuple/list of 2 integers, specifying
+ the dilation rate to use for dilated convolution.
+ Currently, specifying any `dilation_rate` value != 1 is
+ incompatible with specifying any `strides` value != 1.
depth_multiplier: The number of depthwise convolution output channels
for each input channel.
The total number of depthwise convolution output
@@ -1477,6 +1495,7 @@ class SeparableConv2D(_SeparableConv):
strides=(1, 1),
padding='valid',
data_format=None,
+ dilation_rate=(1, 1),
depth_multiplier=1,
activation=None,
use_bias=True,
@@ -1498,6 +1517,7 @@ class SeparableConv2D(_SeparableConv):
strides=strides,
padding=padding,
data_format=data_format,
+ dilation_rate=dilation_rate,
depth_multiplier=depth_multiplier,
activation=activation,
use_bias=use_bias,
