* :math:`X`: Input value, a ``Tensor`` with 'NCL' format or 'NLC' format.
* :math:`X`: Input value, a ``Tensor`` with 'NCL' format or 'NLC' format.
* :math:`W`: Filter value, a ``Tensor`` with shape [MCK] .
* :math:`W`: Filter value, a ``Tensor`` with shape [MCK] .
* :math:`\\ast`: Convolution operation.
* :math:`\\ast`: Convolution operation.
* :math:`b`: Bias value, a 2-D ``Tensor`` with shape [M, 1].
* :math:`b`: Bias value, a 1-D ``Tensor`` with shape [M].
* :math:`\\sigma`: Activation function.
* :math:`\\sigma`: Activation function.
* :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
* :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
...
@@ -259,11 +259,15 @@ class Conv1D(_ConvNd):
...
@@ -259,11 +259,15 @@ class Conv1D(_ConvNd):
is not set, the bias is initialized zero. Default: None.
is not set, the bias is initialized zero. Default: None.
Attribute:
Attribute:
**weight** (Parameter): the learnable weights of filter of this layer.
**weight** (Parameter): the learnable weights of filter of this layer.
**bias** (Parameter or None): the learnable bias of this layer.
**bias** (Parameter or None): the learnable bias of this layer.
Shape:
Shape:
- x: 3-D tensor with shape: (batch, in_channels, length) or (batch, length, in_channels).
- x: 3-D tensor with shape: (batch, in_channels, length) or (batch, length, in_channels).
- weight: 3-D tensor with shape: (out_channels, in_channels, kernel_size)
- bias: 1-D tensor with shape: (out_channels)
- output: 3-D tensor with same shape as input x.
- output: 3-D tensor with same shape as input x.
Raises:
Raises:
...
@@ -444,6 +448,8 @@ class Conv1DTranspose(_ConvNd):
...
@@ -444,6 +448,8 @@ class Conv1DTranspose(_ConvNd):
Shape:
Shape:
- x(Tensor): 3-D tensor with shape (batch, in_channels, length) when data_format is "NCL" or shape (batch, length, in_channels) when data_format is "NLC".
- x(Tensor): 3-D tensor with shape (batch, in_channels, length) when data_format is "NCL" or shape (batch, length, in_channels) when data_format is "NLC".
- weight(Tensor): 3-D tensor with shape (in_channels, out_channels, kernel_length).
- bias(Tensor): 1-D tensor with shape (out_channels).
- output_size(int|tuple|list, optional): The output image size. If output size is a tuple/list, it must contain one integer, (feature_length). None if use kernel_size, padding, output_padding and stride to calculate output_size. If output_size and kernel_size are specified at the same time, They should follow the formula above. Default: None. output_size and kernel_size should not be None at the same time.
- output_size(int|tuple|list, optional): The output image size. If output size is a tuple/list, it must contain one integer, (feature_length). None if use kernel_size, padding, output_padding and stride to calculate output_size. If output_size and kernel_size are specified at the same time, They should follow the formula above. Default: None. output_size and kernel_size should not be None at the same time.
- output(Tensor): 3-D tensor with same shape as input x.
- output(Tensor): 3-D tensor with same shape as input x.
...
@@ -540,7 +546,7 @@ class Conv2D(_ConvNd):
...
@@ -540,7 +546,7 @@ class Conv2D(_ConvNd):
* :math:`X`: Input value, a ``Tensor`` with NCHW format.
* :math:`X`: Input value, a ``Tensor`` with NCHW format.
* :math:`W`: Filter value, a ``Tensor`` with shape [MCHW] .
* :math:`W`: Filter value, a ``Tensor`` with shape [MCHW] .
* :math:`\\ast`: Convolution operation.
* :math:`\\ast`: Convolution operation.
* :math:`b`: Bias value, a 2-D ``Tensor`` with shape [M, 1].
* :math:`b`: Bias value, a 1-D ``Tensor`` with shape [M].
* :math:`\\sigma`: Activation function.
* :math:`\\sigma`: Activation function.
* :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
* :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
...
@@ -590,6 +596,10 @@ class Conv2D(_ConvNd):
...
@@ -590,6 +596,10 @@ class Conv2D(_ConvNd):
- x: :math:`(N, C_{in}, H_{in}, W_{in})`
- x: :math:`(N, C_{in}, H_{in}, W_{in})`
- weight: :math:`(C_{out}, C_{in}, K_{h}, K_{w})`
- bias: :math:`(C_{out})`
- output: :math:`(N, C_{out}, H_{out}, W_{out})`
- output: :math:`(N, C_{out}, H_{out}, W_{out})`
Where
Where
...
@@ -676,15 +686,15 @@ class Conv2DTranspose(_ConvNd):
...
@@ -676,15 +686,15 @@ class Conv2DTranspose(_ConvNd):
filter, and dilations, strides, paddings. Input and output
filter, and dilations, strides, paddings. Input and output
are in NCHW format. Where N is batch size, C is the number of feature map,
are in NCHW format. Where N is batch size, C is the number of feature map,
H is the height of the feature map, and W is the width of the feature map.
H is the height of the feature map, and W is the width of the feature map.
Filter's shape is [MCHW] , where M is the number of input feature map,
Filter's shape is [CMHW] , where C is the number of input feature map,
C is the number of output feature map, H is the height of the filter,
M is the number of output feature map, H is the height of the filter,
and W is the width of the filter. If the groups is greater than 1,
and W is the width of the filter. If the groups is greater than 1,
C will equal the number of input feature map divided by the groups.
C will equal the number of input feature map divided by the groups.
If bias attribution and activation type are provided, bias is added to
If bias attribution and activation type are provided, bias is added to
the output of the convolution, and the corresponding activation function
the output of the convolution, and the corresponding activation function
is applied to the final result.
is applied to the final result.
The details of convolution transpose layer, please refer to the following explanation and references
The details of convolution transpose layer, please refer to the following explanation and references