ConvTranspose3d#
- class ConvTranspose3d(in_channels, out_channels, kernel_size, stride=1, padding=0, output_padding=0, dilation=1, groups=1, bias=True)[source]#
Applies a 3D transposed convolution over an input tensor.
Only support the case that groups = 1 and conv_mode = “cross_correlation”.
ConvTranspose3d
can be seen as the gradient ofConv3d
operation with respect to its input.Convolution3D usually reduces the size of input, while transposed convolution3d works the opposite way, transforming a smaller input to a larger output while preserving the connectivity pattern.
- Parameters:
in_channels (
int
) – number of input channels.out_channels (
int
) – number of output channels.kernel_size (
Union
[int
,Tuple
[int
,int
,int
]]) – size of weight on spatial dimensions. Ifkernel_size
is anint
, the actual kernel size would be(kernel_size, kernel_size, kernel_size)
.stride (
Union
[int
,Tuple
[int
,int
,int
]]) – stride of the 3D convolution operation. Default: 1padding (
Union
[int
,Tuple
[int
,int
,int
]]) – size of the paddings added to the input on all sides of its spatial dimensions. Only zero-padding is supported. Default: 0output_padding (
Union
[int
,Tuple
[int
,int
,int
]]) – size of paddings appended to output. Default: 0dilation (
Union
[int
,Tuple
[int
,int
,int
]]) – dilation of the 3D convolution operation. Default: 1groups (
int
) – number of groups into which the input and output channels are divided, so as to perform agrouped convolution
. Whengroups
is not 1,in_channels
andout_channels
must be divisible by groups, and the shape of weight should be(groups, in_channels // groups, out_channels // groups, depth, height, width)
. Default: 1bias (
bool
) – wether to add a bias onto the result of convolution. Default: True
Note
weight
usually has shape(in_channels, out_channels, depth, height, width)
.bias
usually has shape(1, out_channels, *1)