F.conv_transpose2d
torch.nn.functional.conv_transpose2d(input, weight, bias=None, stride=1, padding=0, output_padding=0, groups=1, dilation=1) → Tensor
對由多個輸入平面組成的輸入圖像應用二維轉(zhuǎn)置卷積算子, 有時也稱為反卷積.
>>> # 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是:輸入通道,輸出通文章來源:http://www.zghlxwxcb.cn/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ù)字或一個元素元組 (sH, sW). 默認值: 1
padding – 在輸入的兩邊隱式加零.可以是單個數(shù)字或一個元素元組 (padH, padW). 默認值: 0
dilation – 核元素之間的空洞. 可以是單個數(shù)字或單元素元組(dH, dW). 默認值: 1
groups – 將輸入分成組。文章來源地址http://www.zghlxwxcb.cn/news/detail-561861.html
到了這里,關于python-函數(shù)用法-F.conv_transpose2d的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!