Conv2d¶
- class
dragon.vm.torch.nn.
Conv2d
(
in_channels,
out_channels,
kernel_size,
stride=1,
padding=0,
dilation=1,
groups=1,
bias=True
)[source]¶ Apply the 2d convolution.
This module excepts the input size \((N, C_{\text{in}}, H, W)\), and output size is \((N, C_{\text{out}}, H_{\text{out}}, W_{\text{out}})\), where \(N\) is the batch size, \(C\) is the number of channels, \(H\) and \(W\) are the height and width of data.
Examples:
m = torch.nn.Conv2d(2, 3, 3, padding=1) x = torch.ones(2, 2, 2, 2) y = m(x)
See also
__init__¶
Conv2d.
__init__
(
in_channels,
out_channels,
kernel_size,
stride=1,
padding=0,
dilation=1,
groups=1,
bias=True
)[source]¶Create a
Conv2d
module.- Parameters:
- in_channels (int) – The number of input channels.
- out_channels (int) – The number of output channels.
- kernel_size (Union[int, Sequence[int]]) – The size of convolution window.
- stride (Union[int, Sequence[int]], optional, default=1) – The stride of convolution window.
- padding (Union[int, Sequence[int]], optional, default=0) – The zero padding size.
- dilation (Union[int, Sequence[int]], optional, default=1) – The rate of dilated convolution.
- groups (int, optional, default=1) – The number of groups to split channels into.
- bias (bool, optional, default=True) –
True
to add a bias on the output.