-
Notifications
You must be signed in to change notification settings - Fork 0
pytorch 참고
Heeseon Cheon edited this page Oct 19, 2020
·
2 revisions
https://pytorch.org/docs/stable/generated/torch.nn.Conv2d.html
CLASS torch.nn.Conv2d(in_channels: int, out_channels: int, kernel_size: Union[T, Tuple[T, T]], stride: Union[T, Tuple[T, T]] = 1, padding: Union[T, Tuple[T, T]] = 0, dilation: Union[T, Tuple[T, T]] = 1, groups: int = 1, bias: bool = True, padding_mode: str = 'zeros')
- stride : controls the stride for the cross-correlation, a single number or a tuple.
- padding : controls the amount of implicit zero-paddings on both sides for padding number of points for each dimension.
- dilation : controls the spacing between the kernel points; also known as the à trous algorithm. It is harder to describe, but this link has a nice visualization of what dilation does.
- groups : controls the connections between inputs and outputs. in_channels and out_channels must both be divisible by groups.
For example,
- At groups=1, all inputs are convolved to all outputs.
- At groups=2, the operation becomes equivalent to having two conv layers side by side, each seeing half the input channels, and producing half the output channels, and both subsequently concatenated.
- At groups= in_channels, each input channel is convolved with its own set of filters, of size: \left\lfloor\frac{out_channels}{in_channels}\right\rfloor⌊ in_channels out_channels