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是:输入通道,输出通文章来源:https://www.toymoban.com/news/detail-561861.html
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) -> Tensor
Applies 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.rst
Args:
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: None
stride: the stride of the convolving kernel. Can be a single number or a
tuple ``(sH, sW)``. Default: 1
padding: ``kernel_size - 1 - padding`` zero-padding will be added to both
sides of each dimension in the input. Can be a single number or a tuple
``(padH, padW)``. Default: 0
output_padding: additional size added to one side of each dimension in the
output shape. Can be a single number or a tuple ``(out_padH, out_padW)``.
Default: 0
groups: split input into groups, :math:`\text{in\_channels}` should be divisible by the
number of groups. Default: 1
dilation: the spacing between kernel elements. Can be a single number or
a tuple ``(dH, dW)``. Default: 1
Examples::
>>> # 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 – 将输入分成组。文章来源地址https://www.toymoban.com/news/detail-561861.html
到了这里,关于python-函数用法-F.conv_transpose2d的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!