num_channels(int): The number of channels in the input image.
in_channels(int): The number of channels in the input image.
num_filters(int): The number of the filter. It is as same as the output
out_channels(int): The number of channels produced by the convolution.
feature map.
kernel_size(int|list|uple): The kernel size. If kernel_size is a tuple,
filter_size(int or tuple): The filter size. If filter_size is a tuple,
it must contain two integers, (kernel_size_H, kernel_size_W).
it must contain two integers, (filter_size_H, filter_size_W).
Otherwise, the kernel will be a square.
Otherwise, the filter will be a square.
output_padding(int|list|tuple, optional): Additional size added to one side
output_size(int or tuple, optional): The output image size. If output size is a
of each dimension in the output shape. Default: 0.
tuple, it must contain two integers, (image_H, image_W). None if use
filter_size, padding, and stride to calculate output_size.
if output_size and filter_size are specified at the same time, They
should follow the formula above. Default: None.
padding(int|str|tuple|list, optional): The padding size. Padding coule be in one of the following forms.
padding(int|str|tuple|list, optional): The padding size. Padding coule be in one of the following forms.
1. a string in ['valid', 'same'].
1. a string in ['valid', 'same'].
2. an int, which means each spartial dimension(depth, height, width) is zero paded by size of `padding` on both sides
2. an int, which means each spartial dimension(depth, height, width) is zero paded by size of `padding` on both sides
...
@@ -312,10 +350,10 @@ class Conv2DTranspose(layers.Layer):
...
@@ -312,10 +350,10 @@ class Conv2DTranspose(layers.Layer):
4. a list[int] or tuple[int] whose length is 2 * number of spartial dimensions. It has the form [pad_before, pad_after, pad_before, pad_after, ...] for all spartial dimensions.
4. a list[int] or tuple[int] whose length is 2 * number of spartial dimensions. It has the form [pad_before, pad_after, pad_before, pad_after, ...] for all spartial dimensions.
5. a list or tuple of pairs of ints. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...]. Note that, the batch dimension and channel dimension are also included. Each pair of integers correspond to the amount of padding for a dimension of the input. Padding in batch dimension and channel dimension should be [0, 0] or (0, 0).
5. a list or tuple of pairs of ints. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...]. Note that, the batch dimension and channel dimension are also included. Each pair of integers correspond to the amount of padding for a dimension of the input. Padding in batch dimension and channel dimension should be [0, 0] or (0, 0).
The default value is 0.
The default value is 0.
stride(int or tuple, optional): The stride size. If stride is a tuple, it must
stride(int|list|tuple, optional): The stride size. If stride is a tuple, it must
contain two integers, (stride_H, stride_W). Otherwise, the
contain two integers, (stride_H, stride_W). Otherwise, the
stride_H = stride_W = stride. Default: 1.
stride_H = stride_W = stride. Default: 1.
dilation(int or tuple, optional): The dilation size. If dilation is a tuple, it must
dilation(int|list|tuple, optional): The dilation size. If dilation is a tuple, it must
contain two integers, (dilation_H, dilation_W). Otherwise, the
contain two integers, (dilation_H, dilation_W). Otherwise, the
dilation_H = dilation_W = dilation. Default: 1.
dilation_H = dilation_W = dilation. Default: 1.
groups(int, optional): The groups number of the Conv2d transpose layer. Inspired by
groups(int, optional): The groups number of the Conv2d transpose layer. Inspired by
...
@@ -324,44 +362,48 @@ class Conv2DTranspose(layers.Layer):
...
@@ -324,44 +362,48 @@ class Conv2DTranspose(layers.Layer):
first half of the input channels, while the second half of the
first half of the input channels, while the second half of the
filters is only connected to the second half of the input channels.
filters is only connected to the second half of the input channels.
Default: 1.
Default: 1.
param_attr (ParamAttr, optional): The parameter attribute for learnable weights(Parameter)
weight_attr (ParamAttr, optional): The parameter attribute for learnable weights(Parameter)
of conv2d_transpose. If it is set to None or one attribute of ParamAttr, conv2d_transpose
of conv2d_transpose. If it is set to None or one attribute of ParamAttr, conv2d_transpose
will create ParamAttr as param_attr. If the Initializer of the param_attr
will create ParamAttr as param_attr. If the Initializer of the param_attr
is not set, the parameter is initialized with Xavier. Default: None.
is not set, the parameter is initialized with Xavier. Default: None.
bias_attr (ParamAttr or bool, optional): The attribute for the bias of conv2d_transpose.
bias_attr (ParamAttr|bool, optional): The attribute for the bias of conv2d_transpose.
If it is set to False, no bias will be added to the output units.
If it is set to False, no bias will be added to the output units.
If it is set to None or one attribute of ParamAttr, conv2d_transpose
If it is set to None or one attribute of ParamAttr, conv2d_transpose
will create ParamAttr as bias_attr. If the Initializer of the bias_attr
will create ParamAttr as bias_attr. If the Initializer of the bias_attr
is not set, the bias is initialized zero. Default: None.
is not set, the bias is initialized zero. Default: None.
use_cudnn(bool, optional): Use cudnn kernel or not, it is valid only when the cudnn
library is installed. Default: True.
act (str, optional): Activation type, if it is set to None, activation is not appended.
Default: None.
data_format (str, optional): Data format that specifies the layout of input.
data_format (str, optional): Data format that specifies the layout of input.
It can be "NCHW" or "NHWC". Default: "NCHW".
It can be "NCHW" or "NHWC". Default: "NCHW".
dtype (str, optional): Data type, it can be "float32" or "float64". Default: "float32".
Attribute:
Attribute:
**weight** (Parameter): the learnable weights of filters of this layer.
**weight** (Parameter): the learnable weights of filters of this layer.
**bias** (Parameter or None): the learnable bias of this layer.
**bias** (Parameter or None): the learnable bias of this layer.
filter_size, padding, and stride to calculate output_size.
The default value is 1.
if output_size and filter_size are specified at the same time, They
should follow the formula above. Default: None.
padding(int|str|tuple|list, optional): The padding size. Padding coule be in one of the following forms.
padding(int|str|tuple|list, optional): The padding size. Padding coule be in one of the following forms.
1. a string in ['valid', 'same'].
1. a string in ['valid', 'same'].
2. an int, which means each spartial dimension(depth, height, width) is zero paded by size of `padding`
2. an int, which means each spartial dimension(depth, height, width) is zero paded by size of `padding`
...
@@ -717,11 +716,9 @@ class Conv3DTranspose(layers.Layer):
...
@@ -717,11 +716,9 @@ class Conv3DTranspose(layers.Layer):
4. a list[int] or tuple[int] whose length is 2 * number of spartial dimensions. It has the form [pad_before, pad_after, pad_before, pad_after, ...] for all spartial dimensions.
4. a list[int] or tuple[int] whose length is 2 * number of spartial dimensions. It has the form [pad_before, pad_after, pad_before, pad_after, ...] for all spartial dimensions.
5. a list or tuple of pairs of ints. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...]. Note that, the batch dimension and channel dimension are also included. Each pair of integers correspond to the amount of padding for a dimension of the input. Padding in batch dimension and channel dimension should be [0, 0] or (0, 0).
5. a list or tuple of pairs of ints. It has the form [[pad_before, pad_after], [pad_before, pad_after], ...]. Note that, the batch dimension and channel dimension are also included. Each pair of integers correspond to the amount of padding for a dimension of the input. Padding in batch dimension and channel dimension should be [0, 0] or (0, 0).
The default value is 0.
The default value is 0.
stride(int|tuple, optional): The stride size. It means the stride in transposed convolution.
output_padding(int|list|tuple, optional): Additional size added to one side
If stride is a tuple, it must contain three integers, (stride_depth, stride_height,
of each dimension in the output shape. Default: 0.