F.conv_transpose2d
torch.nn.functional.conv_transpose2d(input, weight, bias=None, stride=1, padding=0, output_padding=0, groups=1, dilation=1) → Tensor
对由多个输入平面组成的输入图像应用二维转置卷积算子, 有时也称为反卷积.
>>> # With square kernels and equal stride
>>> inputs = torch.randn(1, 4, 5, 5)
>>> weights = torch.randn(4, 8, 3, 3)
>>> F.conv_transpose2d(inputs, weights, padding=1)
其中,weight是:输入通道,输出通
conv_transpose2d = _add_docstr(torch.conv_transpose2d, r"""
conv_transpose2d(input, weight, bias=None, stride=1, padding=0, output_padding=0, groups=1, dilation=1) -> TensorApplies a 2D transposed convolution operator over an input image
composed of several input planes, sometimes also called "deconvolution".See :class:`~torch.nn.ConvTranspose2d` for details and output shape... include:: cudnn_deterministic.rstArgs:input: input tensor of shape :math:`(\text{minibatch} \times \text{in\_channels} \times iH \times iW)`weight: filters of shape :math:`(\text{in\_channels} \times \frac{\text{out\_channels}}{\text{groups}} \times kH \times kW)`bias: optional bias of shape :math:`(\text{out\_channels})`. Default: Nonestride: the stride of the convolving kernel. Can be a single number or atuple ``(sH, sW)``. Default: 1padding: ``kernel_size - 1 - padding`` zero-padding will be added to bothsides of each dimension in the input. Can be a single number or a tuple``(padH, padW)``. Default: 0output_padding: additional size added to one side of each dimension in theoutput shape. Can be a single number or a tuple ``(out_padH, out_padW)``.Default: 0groups: split input into groups, :math:`\text{in\_channels}` should be divisible by thenumber of groups. Default: 1dilation: the spacing between kernel elements. Can be a single number ora tuple ``(dH, dW)``. Default: 1Examples::>>> # With square kernels and equal stride>>> inputs = torch.randn(1, 4, 5, 5)>>> weights = torch.randn(4, 8, 3, 3)>>> F.conv_transpose2d(inputs, weights, padding=1)
torch.nn.functional.conv2d(input, weight, bias=None, stride=1, padding=0, dilation=1, groups=1) → Tensor
input – 输入tensor
weight – 卷积核
bias – 可选的偏置
stride –卷积核的步幅, 可以是单个数字或一个元素元组 (sH, sW). 默认值: 1
padding – 在输入的两边隐式加零.可以是单个数字或一个元素元组 (padH, padW). 默认值: 0
dilation – 核元素之间的空洞. 可以是单个数字或单元素元组(dH, dW). 默认值: 1
groups – 将输入分成组。