Conv3DTranspose¶
-
class
Conv3DTranspose(channels, kernel_size, strides=(1, 1, 1), padding=(0, 0, 0), output_padding=(0, 0, 0), dilation=(1, 1, 1), groups=1, layout='NCDHW', activation=None, use_bias=True, weight_initializer=None, bias_initializer='zeros', in_channels=0, **kwargs)¶ Transposed 3D convolution layer (sometimes called Deconvolution).
The need for transposed convolutions generally arises from the desire to use a transformation going in the opposite direction of a normal convolution, i.e., from something that has the shape of the output of some convolution to something that has the shape of its input while maintaining a connectivity pattern that is compatible with said convolution.
If in_channels is not specified, Parameter initialization will be deferred to the first time forward is called and in_channels will be inferred from the shape of input data.
Parameters: - channels : int
The dimensionality of the output space, i.e. the number of output channels (filters) in the convolution.
- kernel_size :int or tuple/list of 3 int
Specifies the dimensions of the convolution window.
- strides : int or tuple/list of 3 int
Specify the strides of the convolution.
- padding : int or a tuple/list of 3 int,
If padding is non-zero, then the input is implicitly zero-padded on both sides for padding number of points
- output_padding: int or a tuple/list of 3 int
Controls the amount of implicit zero-paddings on both sides of the output for output_padding number of points for each dimension.
- dilation : int or tuple/list of 3 int
Controls the spacing between the kernel points; also known as the a trous algorithm.
- groups : int
Controls the connections between inputs and outputs. At groups=1, all inputs are convolved to all outputs. At groups=2, the operation becomes equivalent to having two conv layers side by side, each seeing half the input channels, and producing half the output channels, and both subsequently concatenated.
- layout : str, default ‘NCDHW’
Dimension ordering of data and weight. Only supports ‘NCDHW’ and ‘NDHWC’ layout for now. ‘N’, ‘C’, ‘H’, ‘W’, ‘D’ stands for batch, channel, height, width and depth dimensions respectively. Convolution is applied on the ‘D’, ‘H’ and ‘W’ dimensions.
- in_channels : int, default 0
The number of input channels to this layer. If not specified, initialization will be deferred to the first time forward is called and in_channels will be inferred from the shape of input data.
- activation : str
Activation function to use. See
Activation(). If you don’t specify anything, no activation is applied (ie. “linear” activation: a(x) = x).- use_bias : bool
Whether the layer uses a bias vector.
- weight_initializer : str or Initializer
Initializer for the weight weights matrix.
- bias_initializer : str or Initializer
Initializer for the bias vector.
- Inputs:
- data: 5D input tensor with shape (batch_size, in_channels, depth, height, width) when layout is NCDHW. For other layouts shape is permuted accordingly.
- Outputs:
out: 5D output tensor with shape (batch_size, channels, out_depth, out_height, out_width) when layout is NCDHW. out_depth, out_height and out_width are calculated as:
out_depth = (depth-1)*strides[0]-2*padding[0]+kernel_size[0]+output_padding[0] out_height = (height-1)*strides[1]-2*padding[1]+kernel_size[1]+output_padding[1] out_width = (width-1)*strides[2]-2*padding[2]+kernel_size[2]+output_padding[2]