提交 5b7740c7 authored 作者: affanv14's avatar affanv14

add documentation

上级 0b2dac70
...@@ -555,6 +555,86 @@ def separable_conv2d(input, ...@@ -555,6 +555,86 @@ def separable_conv2d(input,
subsample=(1, 1), subsample=(1, 1),
filter_flip=True, filter_flip=True,
filter_dilation=(1, 1)): filter_dilation=(1, 1)):
"""
This function will build the symbolic graph for depthwise
convolutions which act separately on the input channels followed by
pointwise convolution which mixes channels.
Parameters
----------
input: symbolic 4D tensor
Mini-batch of feature map stacks, of shape
(batch size, input channels, input rows, input columns).
See the optional parameter ``input_shape``.
depthwise_filters: symbolic 4D tensor
Set of filters used depthwise convolution layer of shape
(depthwise output channels, 1, filter rows, filter columns).
depthwise_filters: symbolic 4D tensor
Set of filters used pointwise convolution layer of shape
(output channels, depthwise output channels, 1, 1).
num_channels: int
The number of channels of the input. Required for depthwise
convolutions.
input_shape: None, tuple/list of len 4 of int or Constant variable
The shape of the input parameter.
Optional, possibly used to choose an optimal implementation.
You can give ``None`` for any element of the list to specify that this
element is not known at compile time.
depthwise_filter_shape: None, tuple/list of len 4 of int or Constant variable
The shape of the depthwise filters parameter.
Optional, possibly used to choose an optimal implementation.
You can give ``None`` for any element of the list to specify that this
element is not known at compile time.
pointwise_filter_shape: None, tuple/list of len 4 of int or Constant variable
The shape of the pointwise filters parameter.
Optional, possibly used to choose an optimal implementation.
You can give ``None`` for any element of the list to specify that this
element is not known at compile time.
border_mode: str, int or tuple of two int
This applies only to depthwise convolutions
Either of the following:
``'valid'``: apply filter wherever it completely overlaps with the
input. Generates output of shape: input shape - filter shape + 1
``'full'``: apply filter wherever it partly overlaps with the input.
Generates output of shape: input shape + filter shape - 1
``'half'``: pad input with a symmetric border of ``filter rows // 2``
rows and ``filter columns // 2`` columns, then perform a valid
convolution. For filters with an odd number of rows and columns, this
leads to the output shape being equal to the input shape.
``int``: pad input with a symmetric border of zeros of the given
width, then perform a valid convolution.
``(int1, int2)``: pad input with a symmetric border of ``int1`` rows
and ``int2`` columns, then perform a valid convolution.
subsample: tuple of len 2
Factor by which to subsample the output.
This applies only to depthwise convolutions
filter_flip: bool
If ``True``, will flip the filter rows and columns
before sliding them over the input. This operation is normally referred
to as a convolution, and this is the default. If ``False``, the filters
are not flipped and the operation is referred to as a cross-correlation.
filter_dilation: tuple of len 2
Factor by which to subsample (stride) the input.
This applies only to depthwise convolutions
Returns
-------
Symbolic 4D tensor
Set of feature maps generated by convolutional layer. Tensor is
of shape (batch size, output channels, output rows, output columns)
"""
input = as_tensor_variable(input) input = as_tensor_variable(input)
depthwise_filters = as_tensor_variable(depthwise_filters) depthwise_filters = as_tensor_variable(depthwise_filters)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论