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 filter. It is as same as the output
out_channels(int): The number of channels produced by convolution.
feature map.
kernel_size (int|list|tuple): The size of convolution kernel.
filter_size (int or tuple): The filter size. If filter_size is a tuple,
stride (int|list|tuple, optional): The stride size. If stride is a tuple, it must
it must contain two integers, (filter_size_H, filter_size_W).
contain two integers, (stride_H, stride_W). Otherwise, the
Otherwise, the filter will be a square.
stride_H = stride_W = stride. Default: 1.
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
...
@@ -153,10 +162,8 @@ class Conv2D(layers.Layer):
...
@@ -153,10 +162,8 @@ class Conv2D(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
num_channels(int): The number of channels in the input image.
in_channels(int): The number of input channels in the input image.
num_filters(int): The number of filter. It is as same as the output image channel.
out_channels(int): The number of output channels produced by the convolution.
filter_size (int|tuple, optional): The filter size. If filter_size is a tuple,
kernel_size (int|list|tuple, optional): The size of the convolving kernel.
it must contain three integers, (filter_size_D, filter_size_H, filter_size_W).
stride (int|list|tuple, optional): The stride size. If stride is a tuple, it must
Otherwise, the filter will be a square, filter_size_depth = filter_size_height
= filter_size_width = filter_size.
stride (int|tuple, optional): The stride size. If stride is a tuple, it must
contain three integers, (stride_D, stride_H, stride_W). Otherwise, the
contain three integers, (stride_D, stride_H, stride_W). Otherwise, the
stride_D = stride_H = stride_W = stride. The default value is 1.
stride_D = stride_H = stride_W = stride. The default value is 1.
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.
...
@@ -526,7 +498,7 @@ class Conv3D(layers.Layer):
...
@@ -526,7 +498,7 @@ class Conv3D(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.
dilation (int|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 three integers, (dilation_D, dilation_H, dilation_W). Otherwise, the
contain three integers, (dilation_D, dilation_H, dilation_W). Otherwise, the
dilation_D = dilation_H = dilation_W = dilation. The default value is 1.
dilation_D = dilation_H = dilation_W = dilation. The default value is 1.
groups (int, optional): The groups number of the Conv3d Layer. According to grouped
groups (int, optional): The groups number of the Conv3d Layer. According to grouped
...
@@ -534,7 +506,8 @@ class Conv3D(layers.Layer):
...
@@ -534,7 +506,8 @@ class Conv3D(layers.Layer):
the first half of the filters is only connected to the first half
the first half of the filters is only connected to the first half
of the input channels, while the second half of the filters is only
of the input channels, while the second half of the filters is only
connected to the second half of the input channels. The default value is 1.
connected to the second half of the input channels. The default value is 1.
param_attr (ParamAttr, optional): The parameter attribute for learnable parameters/weights
padding_mode (str, optional): ``'zeros'``, ``'reflect'``, ``'replicate'`` or ``'circular'``. Default: ``'zeros'``.
weight_attr (ParamAttr, optional): The parameter attribute for learnable parameters/weights
of conv3d. If it is set to None or one attribute of ParamAttr, conv3d
of conv3d. If it is set to None or one attribute of ParamAttr, conv3d
will create ParamAttr as param_attr. If it is set to None, the parameter
will create ParamAttr as param_attr. If it is set to None, the parameter
is initialized with :math:`Normal(0.0, std)`, and the :math:`std` is
is initialized with :math:`Normal(0.0, std)`, and the :math:`std` is
...
@@ -544,21 +517,27 @@ class Conv3D(layers.Layer):
...
@@ -544,21 +517,27 @@ class Conv3D(layers.Layer):
If it is set to None or one attribute of ParamAttr, conv3d
If it is set to None or one attribute of ParamAttr, conv3d
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. The default value is None.
is not set, the bias is initialized zero. The default value is None.
use_cudnn (bool, optional): Use cudnn kernel or not, it is valid only when the cudnn
library is installed. The default value is True.
act (str, optional): Activation type, if it is set to None, activation is not appended.
The default value is 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 "NCDHW" or "NDHWC". Default: "NCDHW".
It can be "NCDHW" or "NDHWC". Default: "NCDHW".
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): the learnable bias of this layer.
**bias** (Parameter): the learnable bias of this layer.